Login
Immutable PageDiscussionInfoAttachments
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 (last edited 2012-06-08 17:13:46 by rei05)