Search found 1 match

by beautidays
Fri Jul 16, 2004 8:32 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 317957

what's the problem??

#include <iostream>
using namespace std;



int main()
{
int t, first, count,last, max=0;

while(cin >> first >> last){
cout << first << " " << last << " ";
if(first>=last)
{
t = first;
first = last;
last = t;
}

int i, j;

for(i=first;i<=last;i++)
{
if(i!=1)
{
j=i;
count = 1 ...

Go to advanced search