Advertisement
dllbridge

Untitled

May 10th, 2023
809
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.14 KB | None | 0 0
  1.                
  2.  
  3.  
  4.                
  5.  
  6. #include   <stdio.h>
  7.  
  8.  
  9.  
  10. char sz[123] = "55";
  11.  
  12. int   n;
  13.  
  14. //////////////////////////////////////////////////
  15. int main()                                      //
  16. {
  17.  
  18.            
  19.     sscanf(sz, "%d" , &n);  
  20.     printf("n = %d\n", n);
  21.    
  22. return 0;
  23. }
  24.  
  25.  
  26.  
  27.  
  28.  
  29. /*
  30. #include   <stdio.h>
  31.  
  32.  
  33.  
  34. char sz[123];
  35.  
  36. //////////////////////////////////////////////////
  37. int main()                                      //
  38. {
  39.  
  40.            
  41.     sprintf(sz, "SONY %cihail ", 77);  
  42.      printf("%s", sz);
  43. return 0;
  44. }
  45.  
  46.  
  47. */
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72. /*
  73.  
  74.  
  75. //  Альтернативный вариант простейшей программы. Exe-файл будет "весить" меньше в несколько десятков раз !!!
  76.  
  77. #include   <stdio.h>
  78. #include  <locale.h>       //  здесь "живёт" setlocale(LC_ALL, "rus");
  79.  
  80.  
  81. char sz[123];
  82.  
  83. //////////////////////////////////////////////////
  84. int main()                                      //
  85. {
  86.  
  87.     setlocale(LC_ALL, "rus");          
  88.     sprintf(sz, "%x", 77);  
  89.      printf("%s", sz);
  90. return 0;
  91. }
  92.  
  93. */
  94.  
  95.  
  96.  
  97.  
  98.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement