Search found 5 matches

by toyman
Sun Jul 30, 2006 10:45 am
Forum: Volume 1 (100-199)
Topic: 102 - Ecological Bin Packing
Replies: 485
Views: 117286

A little program about 102

while(cin>>arr[0]>>arr[1]>>arr[2]>>arr[3]>>arr[4]>>arr[5]>>arr[6]>>arr[7]>>arr[8]){

can this work?

I can get AC!!!
Code:

while (true) {
if (cin.eof()) break;

This is the cause of WA.
This should be changed,
Code:
while (scanf("%d %d %d %d %d %d %d %d %d",
&data[0],&data[1],&data[2 ...
by toyman
Wed Jul 26, 2006 10:02 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 319127

3QQQ~~ :D
My question have solved!!!
Thank your help!! :D
by toyman
Wed Jul 26, 2006 9:11 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 319127

#include<iostream>
using namespace std;
int compute(int i); //define function
main()
{
int max[20],ioo[20],joo[20];//define variables
int swap,x=0,times=0,k;
int h,i=0,j=0;
while((cin>>i>>j)){
ioo[times]=i;
joo[times]=j;
if (i > j){
swap = i;
i = j;
j = swap;
}
max[times] = compute(i ...
by toyman
Wed Jul 26, 2006 7:10 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 319127

Check http://acm.uva.es/p/data/p100.c.html for a sample accepted solution.[/quote]

Your code
while (scanf("%d %d\n",&m,&n)==2){
why shoule "scanf("%d %d\n",&m,&n)==2"....

and my code...
#include<iostream>
using namespace std;
int compute(int i); //define function
main()
{
int h,i,j,max,swap ...
by toyman
Wed Jul 26, 2006 5:56 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 319127

100 Wrong Answer@@ (Plz help)

this is the #100 problem "The 3n+1"

#include<iostream>
using namespace std;
int compute(unsigned int ,unsigned int ,unsigned int ); //define function
main()
{
unsigned int h,i,j,max; //define variables
unsigned int temp[5000];
cout<<"enter two number i,j:"; //enter two number as it's range ...

Go to advanced search