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 added one line
//Марио Величковски
At line 42 added one line
//Марио Величковски
At line 75 added 106 lines
!!Бројот 9
!C++
%%prettify
{{{
//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;
}
}}}
/%
!!Мечето ушко
!C++
%%prettify
{{{
//Филип Бујаровски
#include <iostream>
#include <cstring>
#include <cmath>
#include <math.h>
using namespace std;
int main()
{
int i,j,n,k;
cin>>n;
int niza[n];
int zbir=0;
for(i=0;i<n;i++)
{
cin>>niza[i];
zbir+=niza[i];
}
int x;
bool c[(zbir)+1];
memset(c,false,sizeof(c));
c[0]=true;
for(i=0;i<n;i++)
{
k=niza[i];
for(j=zbir;j>=0;j--)
{
x=j+k;
if(c[j]==true)
{
if(j+k<zbir)
c[j+k]=true;
}
}
}
int p=0,q=0;
for(i=zbir/2;i>=0;i--)
{
if(c[i]==true)
{
p=i;
break;
}
}
q=zbir-p;
cout<<fabs(p-q)><<endl;
return 0;
}
}}}
/%
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