ログイン
編集不可のページディスカッション情報添付ファイル
rei05/C言語/10031

MMA

   1 #include<stdio.h>
   2 #include<string.h>
   3 int main()
   4 {
   5     char command[5],color[1000];
   6     int i=0;
   7     while(1){
   8         scanf("%s",command);
   9         if(strcmp(command,"push")==0){
  10             getchar();
  11             color[i++]=getchar();
  12         }else if(strcmp(command,"pop")==0){
  13             printf("%c\n",color[--i]);
  14         }else if(strcmp(command,"quit")==0){
  15             return(0);
  16         }
  17     }
  18 }

rei05/C言語/10031 (最終更新日時 2012-06-08 17:13:46 更新者 rei05)