Search found 2 matches

by jack1082
Thu Feb 08, 2007 4:35 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 320772

This is my code to problem 100, but I got a WA, can someone tell me where I did wrong? Thanks!

#include<stdio.h>
#include<stdlib.h>
int main(void) {
int i,j,num,tmp,cycle,n=1;
scanf("%d %d",&i,&j);
if ((0<i<1000000) && (0<j<1000000)) {
int p=i>j?j:i;
int q=i<j?j:i;


for (num=p;num<=q;num ...
by jack1082
Thu Feb 08, 2007 2:26 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 320772

(100)Sorry, can someone tell me where I did wrong

This is my code to problem 100, but I got a WA, can someone tell me where I did wrong?

#include<stdio.h>
#include<stdlib.h>
int main(void) {
int i,j,num,tmp,cycle,n=1;
scanf("%d %d",&i,&j);
if ((0<i<1000000) && (0<j<1000000)) {
int p=i>j?j:i;
int q=i<j?j:i;


for (num=p;num<=q;num++) {
tmp=num ...

Go to advanced search