Академический Документы
Профессиональный Документы
Культура Документы
1. .
2. .
3. Microsoft Visual
Studio.
4.
5. C
.
. ,
. .
, ,
, , if switch. ,
,
, . . - . :
#include <iostream>
using namespace std;
void main ()
{
int i=0,j;
while(i<3){
cout<<"\nOut!!!\n";
j=0;
while(j<3){
cout<<"\nIn!!!\n";
j++;
}
i++;
}
cout<<"\nEnd!!!\n";
}
:
1. i<3, 0 3
.
2. Out!!!
3. j.
4. j<3, 0 3
.
5. In!!!
6. j.
7. j<3, 1 3
.
8. In!!!
9. j.
10. j<3, 2 3
.
2
5. C
11. In!!!
12. j.
13. j<3, 3 3
.
1.
(1-13) 3 , . . i
3.
End!!!
,
,
. ,
- .
.
5. C
, ,
.
, ,
.
.
1:
:
, .
5. C
:
#include <iostream>
using namespace std;
void main ()
{
for(int i=1;i<10;i++)
{
for(int j=0;j<10;j++)
{
cout<<i*j<<"\t";
}
cout<<"\n\n";
}
}
:
1.
.
2.
1.
3. i<10, 1 10
.
4.
1.
5. j<10, 1 10
.
6. i j - 1
7. j.
8. j<10, 2 10
.
6. i j - 2
7. j.
...
5 7 j
10, i (1) j ( 1
9 ), .
1.
. ,
i .
2.
5
5. C
,
.
2:
:
20 20.
:
#include <iostream>
using namespace std;
void main(){
int str;
int star_count;
int length=20;
str=1;
while(str<=length)
{
star_count=1;
while(star_count<=length)
{
cout<<"*";
star_count++;
}
cout<<"\n";
str++;
}
}
:
1.
.
str
5. C
2.
.
star_count
3. length -
4.
5. :
: , ,
- !
, .
! ,
. ,
, .
, .
Microsoft Visual Studio.
. .
- .
-
.
. ,
.
5. C
- ,
,
. ,
.
-
,
.
. ,
, .
.
, Visual Studio
- .
.
.
, :
.
, . .
F10.
.
, "".
F10.
:
8
5. C
,
:
Autos - ,
.
- - .
Watch - , ,
. Name
.
F10, "" ,
.
: ,
Shift+F5
: , , ,
.
9
5. C
-
trl+F10
.
,
, .
- .
- cout<<i;
F9.
.
F5, , ,
.
, :
).
10
5. C
.
F10 , . ,
,
.
.
.
, , ,
, . . . , ,
,
. - , , 5
. -
"".
Breakpoint Properties.
11
5. C
,
. i==5. is true -
, . .
.
.
12
5. C
, F5 , . ,
- .
: F9,
, .
.
. , ,
- ,
, . !
1. ,
2 1000. ( ,
1 ; 1 2
).
2. , - :
*********************
*
*
*
*
*
*
*
*
*
*
*
*
*********************
3. .
13