Cod sursa(job #2500847)
Utilizator | Data | 28 noiembrie 2019 19:40:24 | |
---|---|---|---|
Problema | Text | Scor | 70 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.4 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main()
{
string s;
int lung = 0 , litere = 0 ;
while(f>>s)
{
lung++;
int x=s.length();
for(int i=0;i<=x;i++)
{
if(s[i]>='a' && s[i]<='z')
litere++;
if(s[i]>='A' && s[i]<='Z')
litere++;
if(s[i]=='-')
lung++;
}
}
g<<litere/lung;
}