Pagini recente » Cod sursa (job #1272180) | Cod sursa (job #1694918) | Cod sursa (job #2891465) | Cod sursa (job #2974545) | Cod sursa (job #1469832)
#include <iostream>
#include <fstream>
#include <algorithm>
#include <math.h>
#include <string>
#include <vector>
#include <stdio.h>
#define LL long long
using namespace std;
char s;
ofstream f;
ifstream g;
int main()
{
f.open("text.out");
g.open("text.in");
int cnt=0,w=0;
bool ok=false;
while (g.get(s))
{
if ((s-'0'>16 && s-'0'<43) || (s-'0'>48 && s-'0'<75))
{
cnt++;
ok=true;
}
else if (ok)
{
w++;
ok=false;
}
}
if(ok)
w++;
f<<cnt<<' '<<w;
return 0;
}