Cod sursa(job #2205008)
| Utilizator | Data | 17 mai 2018 17:26:05 | |
|---|---|---|---|
| Problema | Text | Scor | 10 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.49 kb |
#include <fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char x,a;
int nr,OK1,d,OK2;
int main()
{
f>>a;
d=1;
nr=2;
while(f>>x)
{
OK1=false;
OK2=false;
if(97<=x && 122>=x)OK1=true;
if(65<=x && 90>=x)OK1=true;
if(97<=a && 122>=a)OK2=true;
if(65<=a && 90>=a)OK2=true;
if(OK1==true && OK2==true)nr++;
else d++;
a=x;
}
g << nr/d;
return 0;
}
