Author: Not specified Language: text
Description: Not specified Timestamp: 2013-06-20 17:42:54 +0000
View raw paste Reply
  1. for (init_statement; condition; iter_statement)
  2.   body_statement;
  3.  
  4. ??????????? ?????, ??? ?
  5.  
  6. init_statement;
  7. while (condition)
  8. {
  9.   body_statement;
  10.   iter_statement;
  11. }
  12.  
  13. ????? ???????,
  14.  
  15. for (init_statement1; condition1; iter_statement1)
  16.   for (init_statement2; condition2; iter_statement2)
  17.     body_statement;
  18.  
  19. ??????????? ?????, ??? ?
  20.  
  21. init_statement1;
  22. while (condition1)
  23. {
  24.   init_statement2;
  25.   while (condition2)
  26.   {
  27.     body_statement;
  28.     iter_statement2;
  29.   }
  30.   iter_statement1;
  31. }
  32.  
  33. ??????????,
  34.  
  35. for (i = 0; i < 5; ++i)
  36.   printf("%d\n", i);
  37.  
  38. ??????????? ?????, ??? ?
  39.  
  40. i = 0;
  41. while (i < 5)
  42. {
  43.   printf("%d\n", i);
  44.   ++i;
  45. }
  46.  
  47. ? ??????????
  48.  
  49. 0
  50. 1
  51. 2
  52. 3
  53. 4
  54.  
  55. ??????????,
  56.  
  57. for (i = 0; i < 5; ++i)
  58.   for (j = 5; j < 10; ++j)
  59.     printf("%d %d\n", i, j);
  60.  
  61. ??????????? ?????, ??? ?
  62.  
  63. i = 0;
  64. while (i < 5)
  65. {
  66.   j = 5;
  67.   while (j < 10)
  68.   {
  69.     printf("%d %d\n", i, j);
  70.     ++j;
  71.   }
  72.   ++i;
  73. }
  74.  
  75. ? ??????????
  76.  
  77. 0 0
  78. 0 1
  79. 0 2
  80. 0 3
  81. 0 4
  82. 1 0
  83. 1 1
  84. 1 2
  85. 1 3
  86. 1 4
  87. 2 0
  88. 2 1
  89. 2 2
  90. 2 3
  91. 2 4
  92. 3 0
  93. 3 1
  94. 3 2
  95. 3 3
  96. 3 4
  97. 4 0
  98. 4 1
  99. 4 2
  100. 4 3
  101. 4 4
View raw paste Reply