想說打都打了,不要浪費!
for(int i = 0 ; i < 9 ; i++){
// work here
}
int i = 0 ;
LOOP_BEGIN :
if(i < 9){
// work here
i++ ;
goto LOOP_BEGIN ;
}else{
goto LOOP_END ;
}
LOOP_END :
#include <iostream>
#include <cstdlib>
using namespace std ;
int main(){
int i = 9;
LOOP_1_BEGIN:
if(i >= 1){
int j = 9 ;
LOOP_2_BEGIN:
if(j >= 1){
cout << i << "*" << j << " " ;
j-- ;
goto LOOP_2_BEGIN ;
}else{
goto END_LOOP_2 ;
}
END_LOOP_2 :
cout << endl ;
i-- ;
goto LOOP_1_BEGIN ;
}else{
goto END_LOOP_1 ;
}
END_LOOP_1 :
system("pause");
return 0 ;
}
沒有留言:
張貼留言