Create 1752.c

pull/19/head
KiritoTRw 2016-05-26 07:38:03 +08:00
parent a341346e33
commit f79234c552
1 changed files with 33 additions and 0 deletions

33
QUSTOJ/1752.c Normal file
View File

@ -0,0 +1,33 @@
#include <stdio.h>
#include <string.h>
char str[2048];
int iStack=0;
char stk[256][256];
int main()
{
gets(str);
int L=strlen(str);
for(int i=0;i<L;i++)
{
if(str[i]==','||str[i]=='.')
{
str[i]=' ';
}
}
char* p=str;
while(sscanf(p,"%s",stk[iStack])==1)
{
p=p+strlen(stk[iStack])+1;
iStack++;
}
for(int i=iStack-1;i>=0;--i)
{
printf("%s ",stk[i]);
}
return printf("\n"),0;
}