Cod sursa(job #1934907)
| Utilizator | Data | 21 martie 2017 21:34:52 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.56 kb |
#include<iostream>
#include<fstream>
using namespace std;
int main()
{
char text[10000];
long long i,Lungime,k,p=0;
fstream f("text.in",ios::in);
f.get(text,10000);
f.get();
f.close();
k=0;
for(i=0;i<=strlen(text);i++)
{
if((text[i]<65)||(text[i]>90)&&(text[i]<97)||(text[i]>122)||(i==strlen(text)))
{
if((text[i-1]>=65)&&(text[i-1]<=90)||(text[i-1]>=97)&&(text[i]<=122))
{
k++;
}
}
else
{
p++;
}
}
Lungime=p/k;
fstream g("text.out",ios::out);
g<<Lungime;
g.close();
cout<<p;
cout<<endl<<k;
}
