Search found 11 matches
- Fri Oct 20, 2006 9:41 pm
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 318831
- Mon Oct 09, 2006 9:07 pm
- Forum: Volume 6 (600-699)
- Topic: 612 - DNA Sorting
- Replies: 122
- Views: 33836
- Thu Oct 05, 2006 6:45 am
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 318831
- Wed Oct 04, 2006 7:18 pm
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 318831
a can be greater than b ,so consider that case also
input:
your output:
which is wrong.
btw, dont create new thread for existing one.
you can search before posting .
input:
Code: Select all
20 10
Code: Select all
20 10 0
btw, dont create new thread for existing one.
you can search before posting .
- Wed Oct 04, 2006 11:15 am
- Forum: Volume 3 (300-399)
- Topic: 337 - Interpreting Control Sequences
- Replies: 20
- Views: 6465
- Wed Oct 04, 2006 8:17 am
- Forum: Volume 3 (300-399)
- Topic: 337 - Interpreting Control Sequences
- Replies: 20
- Views: 6465
- Tue Oct 03, 2006 9:56 pm
- Forum: Volume 1 (100-199)
- Topic: 108 - Maximum Sum
- Replies: 233
- Views: 52003
- Tue Oct 03, 2006 4:51 pm
- Forum: Volume 4 (400-499)
- Topic: 412 - Pi
- Replies: 104
- Views: 30312
Though i am not very sure about your question. Are you looking for this
Code: Select all
#include<iostream>
#include<iomanip>
using namespace std;
main()
{
float x=3;
cout.setf(ios::fixed, ios::floatfield);
cout.precision(7);
cout<<x;
}
- Tue Oct 03, 2006 3:09 pm
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 318831
input:
Your output:
but output should be:
so order of a and b should remain same
Code: Select all
1 2
2 1
Code: Select all
1 2 2
1 2 2
Code: Select all
1 2 2
2 1 2
so order of a and b should remain same
- Tue Oct 03, 2006 10:49 am
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 318831
Your program gives :
input:
output:
which is wrong
correct output for the above input should be:
input:
Code: Select all
1 1
1 2
1 3
1 4
Code: Select all
1 1 3
1 2 3
1 3 7
1 4 7
correct output for the above input should be:
Code: Select all
1 1 1
1 2 2
1 3 8
1 4 8
- Mon Jul 10, 2006 11:04 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10070 - Leap Year or Not Leap Year and ...
- Replies: 233
- Views: 84159
WA
here is my code ..i m getting WA ...please help!! :(
#include<iostream>
#include<cmath>
#include<string>
using namespace std;
bool four(string s)
{ int n=s.length();
int a,b,c;
a=s[n-1]-'0';
b=s[n-2]-'0';
c=10*b+a;
if(c%4==0)
return true;
else
return false;
}
bool five(string s)
{
int ...
#include<iostream>
#include<cmath>
#include<string>
using namespace std;
bool four(string s)
{ int n=s.length();
int a,b,c;
a=s[n-1]-'0';
b=s[n-2]-'0';
c=10*b+a;
if(c%4==0)
return true;
else
return false;
}
bool five(string s)
{
int ...