mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
Create 1752.c
This commit is contained in:
parent
a341346e33
commit
f79234c552
33
QUSTOJ/1752.c
Normal file
33
QUSTOJ/1752.c
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user