{
Double c;
if (a<3)
Return;
else if (b>10)
Return;
Else
{
c=a+b;
if ((2*c-b)==11)
Return;
}
}
return .
goto
goto C/C++ , .
for
for . :
For ( 1; 2; 3)
1 - , .
2 - , , .
3 - , .
for:
- 1;
- 2;
- 2 (), , 3 2, 2 (), , for.
, . , , .
:
Int fun()
{
Int i,b;
for (i=1,b=1; i<10; i++)
b+=i*i;
Return b;
}
1 9. for , .
:
Int main()
{
int top=0, bot=0;
char string[100]=".........";
Char temp;
while(string[bot++]); //
for (bot-=2; top < bot; top++, bot--)
{
temp=string[top]; //
string[bot]=temp;
}
Return 0;
}
, , top boot. , 1 3 , , .
C/C++ , for . .
:
for (i=0; t[i]<10; i++);
i t, 10.
, for. for , , .
|
|
. , for ( ) . .
while
while :
While ()
C/C++, , . while :
- .
, while . , while.
1.
:
for (-1; -2; - 3) ;
while :
- 1;
while (-2)
{
-3;
}
.
# include <iostream.h>
void main()
{
char key=121;
while(key= =121)
{
cout<<"[y/n]:";
cin>>key;
}
}
for, while . while , . for while , .
do..while
do while , . :
Do
While ();
do while:
- ( );
- ;
- , do while . , 1.
, , break. while do while .
:
Int i,j,k;
...
i=0; j=0; k=0;
Do
{
i++;
J--;
while (a[k] < i) k++;
}
while (i<30 && j<-30);
1.
2.
3. ? .
4. ? .
5. ? .
3