Add new attachment

Only authorized users are allowed to upload new attachments.

List of attachments

Kind Attachment Name Size Version Date Modified Author Change note
cpp
main.cpp 0.3 kB 4 20-Aug-2015 17:35 metotra Инженер, регионален 2013, напредна група

This page (revision-6) was last changed on 08-Nov-2015 12:45 by Penkov

This page was created on 20-Aug-2015 17:35 by mariomako

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Difference between version and

At line 6 changed one line
//Марио Величковски
//v10
At line 8 added one line
At line 10 added one line
At line 11 changed 22 lines
int p,v;
cin>>p>>v;
int kusur=v-p, i=0;
while(kusur>0)
{
if(kusur>=5)
{
kusur-=5;
i++;
}
else if(kusur>=2)
{
kusur-=2;
i++;
}
else if(kusur>=1)
{
kusur-=1;
i++;
}
}
cout<<i;
int n,m,a=0,b,c;
cin>>n>>m;
c=m-n;
a+=c/5;
c-=(c/5)*5;
a+=c/2;
c-=(c/2)*2;
a+=c;
cout<<a<<endl;
At line 42 changed one line
//Марио Величковски
//v10
At line 33 added one line
At line 35 added one line
At line 47 changed 25 lines
int z,r;
cin>>z>>r;
int x,y;
y=(z+r)/2;
x=z-y;
int p1,p2;
if(x>y)
{
p1=x;
p2=y;
}
else
{
p1=y;
p2=x;
}
if(y<0 || x<0 || r!=p1-p2 || z!=p1+p2)
{
cout<<"NE MOZE";
}
else
{
cout<<p1<<" "<<p2;
}
return 0;
int n,m,a,b;
cin>>n>>m;
a=(n+m)/2;
b=n-a;
if(a>=0&&b>=0&&(n+m)%2==0)cout<<a<<" "<<b<<endl;
else cout<<"NE MOZE"<<endl;
At line 80 changed 41 lines
//mprelevic - Brojot 9 (test 2013)
#include <iostream>
#include <string>
using namespace std;
int main()
{
string broj;
int zbirCifri,tmp;
int cekori;
cekori = -1;
getline (cin,broj);
zbirCifri = 0;
for(int i = 0; i < broj.length(); i++)
{
zbirCifri += broj[i] - '0';
}
//cout << zbirCifri << endl;
tmp = zbirCifri;
if ((zbirCifri % 9) == 0)
{
cekori = 0;
}
else
{
cekori = 0;
while( (zbirCifri % 9) != 0)
{
zbirCifri += tmp;
cekori++;
}
}
cout << cekori;
//cin.get();cin.get();
return 0;
}
//v10
#include <iostream>
using namespace std;
int main()
{
int n,m,a=0,b,c;
long long sum=0;
string ab;
cin>>ab;
for(int i=0;i<ab.size();i++)sum+=ab[i]-48;//-48 za da go konvertiras od ASCII u dekaden
if(sum%9==0)cout<<'0'<<endl;
else if(sum%3==0)cout<<'2'<<endl;//ako e deliv so 3 a ne so 9 treba da se dodate istiot broj uste 2 pati.
else cout<<'8'<<endl;//ako ne e deliv so 9 nitu pak 3 togas e zaemno prost so 9 pa treba da se sobere use 8 pati.
}
Version Date Modified Size Author Changes ... Change note
6 08-Nov-2015 12:45 2.84 kB Penkov to previous
5 08-Nov-2015 12:45 2.811 kB Lord_of_Life to previous | to last
4 20-Aug-2015 17:35 2.356 kB v10 to previous | to last
3 20-Aug-2015 17:35 2.351 kB v10 to previous | to last
2 20-Aug-2015 17:35 3.237 kB mariomako to previous | to last
1 20-Aug-2015 17:35 0.948 kB mariomako to last
« This page (revision-6) was last changed on 08-Nov-2015 12:45 by Penkov