Cod sursa(job #880101)

Utilizator 5t3fristea stefan 5t3f Data 16 februarie 2013 11:56:27
Problema Litere Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.39 kb
// litere.cpp : Defines the entry point for the console application.
//

//#include "stdafx.h"
#include "fstream"
using namespace std;
int main()
{
	ifstream f("litere.in");
	ofstream g("litere.out");
	int nr,i,sch=0;
	char sir[10000];
	f>>nr;
	f>>sir[0];
	for(i=1;i<nr;i++)
	{
		f>>sir[i];
		int j;
		for(j=0;j<i;j++)
			if(sir[j]>sir[i])
				sch++;
	}
	g<<sch;
	return 0;
}