mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
Create 1360.cpp
This commit is contained in:
parent
c22d476980
commit
e8eca9546f
33
QUSTOJ/1360.cpp
Normal file
33
QUSTOJ/1360.cpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
using namespace std;
|
||||
|
||||
int a,b,c,d;
|
||||
char buff[2048];
|
||||
int main()
|
||||
{
|
||||
gets(buff);
|
||||
int L=strlen(buff);
|
||||
for(int i=0;i<L;i++)
|
||||
{
|
||||
if((buff[i]>='a'&&buff[i]<='z')||(buff[i]>='A'&&buff[i]<='Z'))
|
||||
{
|
||||
a++;
|
||||
}
|
||||
else if(buff[i]>='0'&&buff[i]<='9')
|
||||
{
|
||||
b++;
|
||||
}
|
||||
else if(buff[i]==' ')
|
||||
{
|
||||
c++;
|
||||
}
|
||||
else
|
||||
{
|
||||
d++;
|
||||
}
|
||||
}
|
||||
printf("%d %d %d %d \n",a,b,c,d);
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user