Cod sursa(job #615876)

Utilizator ionutmodoModoranu Ionut-Vlad ionutmodo Data 11 octombrie 2011 09:12:54
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.55 kb
#include<fstream>
#include<cstring>

using namespace std;

char s[205],mat[205][205];

bool Ver(char x)
{
	return ( ('a'<=x && x<='z') || ('A'<=x && x<='Z'));
}

int main ()
{
	int i,j,k,L,x;
	
	ifstream fin("text.in");
		fin.getline(s,203);
	fin.close();
	
	L = strlen(s);
	k = j = 0;
	
	for(i=0; s[i]!=0; i++)
	{
		if( Ver(s[i]) )
			mat[k][j++] = s[i];
		else 
		{
			mat[k][j] = 0;
			k++;
			j=0;
		}
	}
	mat[k][j] = 0;
	
	x = L / k;
	
	ofstream fout("text.out");
	fout<<x<<"\n";
	fout.close();
	
	return 0;
}