Advertisement
dllbridge

Untitled

Jan 25th, 2023
754
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.83 KB | None | 0 0
  1.  
  2. #include  <stdio.h>
  3. #include <string.h>
  4.  
  5. char sz1[99] =      "sony",
  6.      sz2[99] = " pictures";  
  7. int _strcopy(char*, const char* u);
  8.  
  9.  
  10. /////////////////////////////////////////////////////
  11. int main()                                         //  
  12. {  
  13.    
  14.     printf("%s\n", sz2);   
  15.     strcpy(sz2, sz1);
  16.    
  17.     printf("%s", sz2);
  18.    
  19. }
  20.    
  21.    
  22.    
  23.    
  24.    
  25.    
  26.    
  27.    
  28.    
  29.    
  30.    
  31.  
  32. /*
  33.  
  34. #include <stdio.h>
  35.  
  36. char sz[99] = "sony pictures";
  37.  
  38. int _strlen(const char* u);
  39.  
  40.  
  41. /////////////////////////////////////////////////////
  42. int main()                                         //  
  43. {  
  44.     int a = 1;
  45.  
  46.     a = _strlen(sz);
  47.     printf("%d", a);
  48. }
  49.  
  50.  
  51. /////////////////////////////////////////////////////
  52. int _strlen(const char* u)                         //
  53. {
  54.     int i = 0;  
  55.  
  56.     while( u[++i] ) ;
  57.  
  58. return i;
  59. }
  60.  
  61.  
  62.  
  63. */
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81. /*
  82. /////////////////////////////////////////////////////
  83. int _strlen(const char* u)                         //
  84. {
  85.     int size = -1,
  86.            i = -1;  
  87.  
  88. L_01:   size++;
  89.  
  90.         i++;
  91.         if(u[i] != 0) goto L_01;
  92.  
  93.     return size;
  94. }
  95.  
  96. */
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112. //    a = strlen(sz);
  113. //    printf("%d, %s", a, sz);
  114.     //printf("\n%s\n", u);
  115.   //scanf ("%d", &a);
  116.  
  117.  
  118.  
  119. //#include <string.h>
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156. /*
  157. #include  <iostream>
  158. #include    <string>
  159. using namespace std;
  160.  
  161.  
  162. /////////////////////////////////////////////////////////
  163. int main()
  164. {
  165.    
  166.     int  n = 0,
  167.          b = 0;
  168.     string str;
  169.    
  170.     cin >> n;
  171.    
  172.     for (int i = 0; i < n; i++)
  173.     {
  174.         cin >> str;
  175.        
  176.         if(str == "++X")  b++;            
  177.         if(str == "X++")  b++;
  178.         if(str == "--X")  b--;  
  179.         if(str == "X--")  b--;          
  180.     }
  181.    
  182.     cout << b;
  183. }
  184.  
  185.  
  186.  
  187.  
  188. */
  189.  
  190.  
  191.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement