Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
class:os2014f:hw1 [2014/09/11 09:56]
mhshin
class:os2014f:hw1 [2025/10/13 12:45] (current)
Line 8: Line 8:
  
 <​code>​ <​code>​
- char *word_list[10][20]; ​+#include <​stdio.h>​ 
 +#include <​stdlib.h>​ 
 +#include <​random>​ 
 + 
 +int main( void ) 
 +
 + char word_list[10][20]; ​
  
  int word_cnt;  int word_cnt;
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>​
  
 
class/os2014f/hw1.1410404218.txt.gz · Last modified: 2025/10/13 13:00 (external edit) · [Old revisions]
Recent changes RSS feed Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki