Advertisement
dllbridge

Untitled

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