Advertisement
dllbridge

Untitled

Jan 17th, 2024
945
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.05 KB | None | 0 0
  1.  
  2.  
  3. /*
  4. #include   <stdio.h>
  5. #include  <locale.h>  
  6.  
  7.  
  8. ///////////////////////////////////////////////
  9. int main()                                   //
  10. {
  11.    
  12.     setlocale(LC_ALL, "rus");
  13.    
  14.     int number,                              //            kljlkjlkj
  15.          price,                              //                ioioi
  16.          summa;
  17.  
  18.     printf("Введите количество книг: ");    scanf("%d", &number);
  19.  
  20.  
  21.     for (int i = 0; i <= number; i++)
  22.     {
  23.         printf("%d books: ", i);
  24.  
  25.         if (i == 0)
  26.         {
  27.             price = 0;
  28.         }
  29.  
  30.         else if (i % 8 == 0 || i == 1)
  31.         {
  32.             price = 1000;
  33.         }
  34.         else
  35.         {
  36.             price -= 55;
  37.         }
  38.  
  39.         summa += price;
  40.         printf("%d\n", summa);
  41.     }
  42.    
  43. return 0;
  44. }
  45.  
  46.  
  47. */
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56. #include   <stdio.h>
  57.  
  58.  
  59.  
  60.  
  61.  
  62. char sz[19] = "SONY Pictures";        
  63.  
  64.  
  65. /////////////////////////////////////////////////////////////
  66. int main()                                                 //
  67. {
  68.    
  69.     sz[2] = '4'  ;
  70.     sz[9] = '\0' ;  
  71.    
  72.     printf("%s \n", sz);
  73.    
  74.     for(int i = 0; i < 19; i += 1)
  75.     {
  76.        printf("%d \n", sz[i]);
  77.     }
  78. }
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94. /*
  95.  
  96. #include   <stdio.h>
  97.  
  98.  
  99.  
  100.  
  101.  
  102. void foo(int *);
  103.  
  104.  
  105. /////////////////////////////////////////////////////////////
  106. int main()                                                 //
  107. {
  108.    
  109.  
  110.     int nArr[12];  
  111.            
  112.  
  113.     foo(nArr);
  114.    
  115. }
  116.  
  117.  
  118.  
  119. ////////////////////////////////////////////////////////////
  120. void foo(int *nArr)
  121. {
  122.    
  123.     printf("address of nArr[0]  = %d\n",  nArr    );
  124.     printf("address of nArr[0]  = %d\n", &nArr[3] );    
  125. }
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133. */
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141. /*
  142.  
  143. #include   <stdio.h>
  144.  
  145.  
  146. int n = 71;
  147.  
  148. int *p = &n;
  149.  
  150.  
  151.  
  152. /////////////////////////////////////////////////////////////
  153. int main()                                                 //
  154. {
  155.    
  156.  
  157.                
  158.     printf("address of n  = %d\n",  p );    
  159.     printf("address of n  = %d\n", &n );
  160.     printf("address of p  = %d\n", &p );       
  161.  
  162. return 0;
  163. }
  164.  
  165.  
  166.  
  167. */
  168.  
  169.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement