C language-cyclic structure

Source: Internet
Author: User


<喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> VcD4KPHA + pgltzybzcm9 "http://www.2cto.com/uploadfile/Collfiles/20140611/2014061109025258.jpg" alt = "\">


# Import
 
  
Int main (int argc, const char * argv []) {# pragma mark --------------- while LOOP // do not show an endless loop // printf ("hello lanou \ n "); // printf ("hello lanou \ n "); // printf ("hello lanou \ n "); // printf ("hello lanou \ n "); // printf ("hello lanou \ n"); // printf ("hello la Nou \ n "); // printf (" hello lanou \ n "); // printf (" hello lanou \ n "); // printf ("hello lanou \ n"); // cyclic body, cyclic body hello lanou // int I = 10; // while (I> 0) {// printf ("hello lanou \ n"); // I --; //} // int I = 0; // while (I <10) {// printf ("hello lanou \ n"); // I ++; //} // int I = 4; // while (I> = 0) {// printf ("% d", I); // I --; //} // int I = 1; // print multiples of 7 // while (I <100) {// if (I % 7 = 0) {// printf ("% d", I ); ///} // I ++; //} // Print the number of digits with a single digit of 7 // while (I <100) {// if (I % 10 = 7) {// printf ("% d", I); //} // I ++; //} // print the number of 10 to 7 // while (I <100) {// if (I/10 = 7) {// printf ("% d", I); //} // I ++; // print out a multiple of 7, and does not contain the number of 7 // while (I <100) {// if (I % 7! = 0 & I/10! = 7 & I % 10! = 7) {// printf ("% d", I); //} else {// printf ("over"); //} // I ++; //} // printf ("\ n"); // printf ("\ n"); // int j = 100; // while (j> 0) {// if (j % 7! = 0 & j % 10! = 7 & j/10! = 7) {// printf ("% d", j); //} else {// printf ("over"); //} // j --; //} // printf ("\ n"); // printf ("\ n"); // int a = arc4random () % 71 + 10; // printf ("% d", a); // random number [n, m] arc4random () % (m-n + 1) + n // print n random numbers // printf ("enter a number:"); // int I = 0, n = 0; // scanf ("% d", & n); // while (n> 0) {// I = arc4random () % 21 + 10; // printf ("% d", I); // n --; //} // printf ("enter a number:"); // int I = 0, n = 0, max = 0; // scanf ("% d", & n); // while (n> 0) {// I = arc4random () % 41 + 30; // printf ("% d", I); // if (max
  
   
I? Max: I; // n --; //} // printf ("\ nmax = % d", max); // printf ("enter a number :"); // int n = 0, I = 0, max = 0; // scanf ("% d", & n); // while (I
   
    
0 & I <9) {// I ++; // continue; //} // printf ("% d", I); // I ++; /// I ++ forgot to execute an endless loop // at least once. It also supports break and continue // int I = 0; // do {// printf ("% d", I); // I ++; //} while (I <101 ); // for (int I = 0; I <101; I ++) {// printf ("% d", I ); ///} // for (int I = 1; I <101; I ++) {// a multiple of 7, 10 is 7, A single digit is 7 printed // if (I % 7 = 0 | I/10 = 7 | I % 10 = 7) {// printf ("over"); // other printed numbers //} else {// printf ("% d", I ); ///} //} # pragma mark --------------- nested loop // for (int I = 0; I <3; I ++) {// for (int j = 1; j <4; j ++) {// printf ("% d", j); // break; for //} // printf ("\ n"); //} // for (int I = 0; I <3; I ++) {// for (int j = 0; j <3; j ++) {// printf ("% d", arc4random () % 21 + 10 ); //} // printf ("\ n"); //} // for (int I = 0; I <1; I ++) {// printf ("% d", arc4random () % 21 + 10); //} // printf ("\ n "); // for (int j = 0; j <2; j ++) {// printf ("% d", arc4random () % 21 + 10 ); //} // printf ("\ n"); // for (int k = 0; k <3; k ++) {// printf ("% d ", arc4random () % 21 + 10); // printf ("\ n"); // for variable, specify the quantity. // for (int I = 0; I <1; I ++) {// for (int j = 0; j <2; j ++) {// for (int k = 0; k <3; k ++) {// printf ("% d", arc4random () % 21 + 10 ); /// printf ("\ n"); //} // printf ("\ n"); //} // printf ("\ n "); //} // for variable to be converted to quantitative. // First, write and analyze the similarities and differences (intermediate process and intermediate thinking) ----- write simple code // for (int I = 0; I <3; I ++) {// for (int j = 0; j <= I; j ++) {// printf ("% d", j); //} // printf ("\ n "); ///} // for (int I = 1; I <10; I ++) {// for (int j = 1; j <10; j ++) {// printf ("% d * % d = % 2d", I, j, I * j); //} // printf ("\ n "); //} //-2d %,-minus sign indicates left alignment, and 2d indicates controlling 2 digits // for (int I = 1; I <10; I ++) {// for (int j = 1; j <= I; j ++) {// printf ("% dx % d = %-2d", I, j, I * j); //} // printf ("\ n"); // print three numbers) possible three-digit combination of // for (int I = 1; I <10; I ++) {// for (int j = 0; j <10; j ++) {// for (int k = 0; k <10; k ++) {// printf ("% d", I, j, k); //} // printf ("\ n"); //} return 0 ;}
   
  
 


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.