// A simple Applet
# Include "stdio. H" Int main () { Int I, J, K; Printf ("all the number are \ n "); For (I = 0; I <5; I ++) For (j = 0; j <5; j ++) For (k = 0; k <5; k ++) printf ("% d, % d, % d \ n", I, j, k ); Printf ("If delete the case I = J = k \ n "); For (I = 0; I <5; I ++) For (j = 0; j <5; j ++) For (k = 0; k <5; k ++ ){ If (I! = J & I! = K & J! = K) Printf ("% d, % d, % d \ n", I, j, k );} Getchar ();} |
// Print the multiplication table
# Include <stdio. h> Void printf (INT ); Int main () { Int I; For (I = 1; I <= 9; I ++ ){ Printf (I ); Printf ("\ n "); } Getchar (); } Void printf (INT hang_number ){ Int I; For (I = 1; I <= hang_number; I ++) printf ("% d * % d = % d \ t", I, hang_number, I * hang_number ); } |
// Output all prime numbers within N and calculate the number
# Include <stdio. h> # Define n 1000 Int issu_num (INT ); Int main () { Int Total = 0; For (INT I = 1; I <= N; I ++) { If (issu_num (I) = 1) { Printf ("% d", I ); Printf ("\ n "); Total ++; } } Printf ("% d in total", total ); Getchar (); } Int issu_num (int I ){ Int flag = 1; For (Int J = 2; j <I; j ++) { If (I % J = 0) Flag = 0; } Return flag; } |