This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
class:os2014f:hw1 [2014/09/11 09:57] mhshin |
class:os2014f:hw1 [2025/10/13 12:45] (current) |
||
|---|---|---|---|
| Line 8: | Line 8: | ||
| <code> | <code> | ||
| + | #include <stdio.h> | ||
| + | #include <stdlib.h> | ||
| + | #include <random> | ||
| + | |||
| + | int main( void ) | ||
| + | { | ||
| char word_list[10][20]; | char word_list[10][20]; | ||
| Line 18: | Line 24: | ||
| for( int i=0; i<word_cnt; i++) { | for( int i=0; i<word_cnt; i++) { | ||
| - | printf("Enter %d th word:", i); | + | printf("Enter %d th word:", i+1); |
| scanf("%s", word_list[i]); | scanf("%s", word_list[i]); | ||
| } | } | ||
| + | printf("## Word List ##\n"); | ||
| + | | ||
| + | for( int i=0; i<10; i++) { | ||
| + | printf("The %d th word is %s\n", i+1, word_list[i]); | ||
| + | } | ||
| + | |||
| + | system("pause"); | ||
| + | | ||
| + | return 0; | ||
| + | } | ||
| </code> | </code> | ||