[Logo] Mendo Judge Discussion Board - Forums
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
Trening del  XML
Forum Index » Други задачи
Author Message
stec_93



Joined: 14/02/2010 15:24:35
Messages: 36
Offline

Da ne ima nekoj problem so online judge-ot vo trening delot?
stec_93



Joined: 14/02/2010 15:24:35
Messages: 36
Offline

za zadacati zadaci od lanskiot drzaven natprevar go prativ slednovo reshenie shto mislam deka mi e tocno, megjutoa na site test primeri pishuva pogreshen odgovor.
#include <iostream>
using namespace std;
int main ()
{
int denovi=0,clenovi,zadaci,final_zadaci=0,novi_clenovi1=0,novi_clenovi2=0,temp;
cin>>clenovi>>zadaci;

temp=clenovi%5;
novi_clenovi1=clenovi/5;

if (temp==1 || clenovi==7)
{

novi_clenovi1-=1;
novi_clenovi2+=2;
}
if (temp==2 && clenovi!=7)
{
novi_clenovi1-=2;
novi_clenovi2+=4;
}
if (temp==3)
{
novi_clenovi2+=1;
}
if (temp==4)
{
novi_clenovi1-=1;
novi_clenovi2+=3;
}



do
{

final_zadaci+=((novi_clenovi1*9)+(novi_clenovi2*5));



denovi++;
}while(final_zadaci<zadaci);
cout<<denovi<<endl;
system("Pause");
return 0;
}





Denis


[Avatar]

Joined: 29/01/2010 18:55:07
Messages: 27
Offline

Za 4 i 6 ti dava 1, a treba 2

The function of good code is to make the complex appear to be simple.
[Email]
Denis


[Avatar]

Joined: 29/01/2010 18:55:07
Messages: 27
Offline

i trgni go system("PAUSE")

The function of good code is to make the complex appear to be simple.
[Email]
stec_93



Joined: 14/02/2010 15:24:35
Messages: 36
Offline

Da sega go primetiv toa system("PAUSE"). fala
 
Forum Index » Други задачи
Go to:   
Powered by JForum 2.1.8 © JForum Team