Advertisement
dllbridge

Untitled

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