#include <iostream>
#include <conio.h>
#include <fstream>
#include <string>
#include <math.h>
using namespace std;
int f (string t)
{
int i,A=0,b=0,x;
for(i=t.size()-1;i>=0;i--,b++)
{
x=t[i]-'0';
A=A+x*pow(10,b);
}
return A;
}
int fx (string t)
{
int i,p=0,A=0,x;
for(i=t.size()-1;i>=0;i--,p++)
{
x=t[i]-'0';
A=A+x*pow(8,p);
}
return A;
}
int main()
{
int i,l=0,e,c,b,l1=0,d=0,x=0,max,min,suma=0;
string txt,a;
ifstream tekst("dane.txt");
if(tekst.is_open())
{
while(tekst.good())
{
getline(tekst,txt);
if(txt.size())
{
if(txt[0]==txt[txt.size()-1])
l++;
e=fx(txt);
c=e;
a="";
while(c>=1)
{
b=c%10;
a=char(b+'0')+a;
c=c/10;
}
if(a[0]==a[a.size()-1])
l1++;
d=0;
for(i=0;i<txt.size()-1;i++)
{
if(txt[i+1]>=txt[i])
d++;
}
c=txt.size()-1;
if(d==c)
{
suma++;
if(x==0)
{
max=f(txt);
min=f(txt);
x++;
}
else
{
if(f(txt)>max)
max=f(txt);
if(f(txt)<min)
min=f(txt);
}
}
}
}
tekst.close();
}
cout << "Pierwsza cyfra jest rowna ostatniej - ile liczb: " << l;
cout << "\nPodpunkt b: " << l1 << endl;
cout << "Liczb tworzacych ciag: " << suma << endl;
cout << "Najwieksza z ciagu to: " << max << endl;
cout << "Najmniejsza z ciagu to: " << min << endl;
getch();
return 0;
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}