Cod sursa(job #1235601)
Utilizator | Data | 30 septembrie 2014 01:23:20 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.34 kb |
#include <fstream>
#include <algorithm>
#include <stdio.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int k,z;
char s,x;
int main()
{
while(f.get(s)){
if((s>='a' && s<='z') || (s>='A' && s<='Z')) z++;
else if((x>='a' && x<='z') || (x>='A' && x<='Z')) k++;
x=s;
}
g<<z/k;
return 0;
}