# 4 1 little 2 little 3 little 4

• Slides: 18
Download presentation

4人のインディアン 1 little 2 little 3 little 4 little indian boys

1 little 2 little 3 little 4 little indian boys #include <stdio. h> main() { printf( "1 little printf( "2 little printf( "3 little printf( "4 little } " ); indian boysn" );

1 little 2 little 3 little 4 little indian boys #include <stdio. h> main() { int ik; for( ik = 1 ; ik <= 3 ; ik++ ) { printf( "%d little ", ik ); } printf( "%d little indian boysn", ik ); }

9人のインディアン 1 little 2 little 3 little 4 little indians, 5 little 6 little 7 little 8 little indians, 9 little indian boys!!

#include <stdio. h> main() { int im, ik; for( im = 1; im <= 2; im++ ) { for( ik = 1; ik <= 4; ik++ ) { printf( "%d little ", (im-1)*4+ik ); } printf("indians, n" ); } printf( "%d little indian boys!!n", (im-1)*(ik-1)+1 ); }

n人のインディアン 1 little 2 little 3 little 4 little indians, 5 little 6 little 7 little 8 little indians, 9 little indian boys!!

#include <stdio. h> #define MAXLEN 20 main() { int im, ik; int nk, nm; int kaisu; char meisi[MAXLEN+1]; printf( "詩の個数は？" ); scanf( "%d", &kaisu ); while( kaisu > 0 ) { kaisu = kaisu - 1; } }

printf( "何人ずつ？" ); scanf( "%d", &nk ); printf( "何行？" ); scanf( "%d", &nm ); printf( "名詞は？" ); scanf( "%s", meisi ); for( im = 1; im <= nm; im++ ){ for( ik = 1; ik <= nk; ik++ ){ printf( "%d little ", (im-1)*4+ik ); } printf("%ss, n", meisi); } printf( "%d little %s boys!!n", (im-1)*(ik-1)+1, meisi );