Cod sursa(job #2325589)
Utilizator | Data | 22 ianuarie 2019 19:19:45 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.47 kb |
#include <fstream>
#include <cstring>
#include<cctype>
using namespace std;
ifstream cin("text.in");
ofstream cout("text.out");
int main()
{
char c1,c2;
int k=0, k1=0;
c1=cin.get();
if(isalpha(c1))
k++,k1++;
while((c2=cin.get())!=-1){
if(isalpha(c2)){
k++;
if(!isalpha(c1))
k1++;
}
c1=c2;
}
if(k!=0)
cout<<k/k1;
else
cout<<0;
return 0;
}