Cod sursa(job #2533921)
| Utilizator | Data | 29 ianuarie 2020 20:49:46 | |
|---|---|---|---|
| Problema | Text | Scor | 30 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.56 kb |
#include<fstream>
#include<string.h>
using namespace std;
ifstream f ("text.in");
ofstream g ("text.out");
int k,kc,i;
char s[1000];
int main()
{
f.get(s,1000);
for(i=0;i<strlen(s);i++)
if((s[i]>='a'&&s[i]<='z')||(s[i]>='A'&&s[i]<='Z'))
k++;
i=0;
while(i<strlen(s))
{while((s[i]>='a'&&s[i]<='z')||(s[i]>='A'&&s[i]<='Z'))
i++;
i++;
if((s[i]>='a'&&s[i]<='z')||(s[i]>='A'&&s[i]<='Z'))
kc++;}
if(i>strlen(s))
kc++;
if(kc!=0)
g<<k/kc;
}
