Search found 7 matches
- Tue May 10, 2005 6:36 pm
- Forum: Volume 103 (10300-10399)
- Topic: 10370 - Above Average
- Replies: 62
- Views: 29169
- Tue May 10, 2005 5:41 pm
- Forum: Volume 103 (10300-10399)
- Topic: 10370 - Above Average
- Replies: 62
- Views: 29169
- Tue May 10, 2005 1:28 am
- Forum: Volume 100 (10000-10099)
- Topic: 10055 - Hashmat the Brave Warrior
- Replies: 166
- Views: 77076
10055 C++ WA
#include <iomanip.h>
#include <iostream.h>
int main ()
{
long double hashmat, other, difference;
while(cin >> hashmat >> other)
{
difference = hashmat - other;
if(difference < 0)
cout << (difference * -1) << endl;
else
cout << difference << endl;
}
}
The program works for all the Sample ...
#include <iostream.h>
int main ()
{
long double hashmat, other, difference;
while(cin >> hashmat >> other)
{
difference = hashmat - other;
if(difference < 0)
cout << (difference * -1) << endl;
else
cout << difference << endl;
}
}
The program works for all the Sample ...
- Mon May 09, 2005 10:09 pm
- Forum: Volume 103 (10300-10399)
- Topic: 10370 - Above Average
- Replies: 62
- Views: 29169
- Sun May 08, 2005 4:34 am
- Forum: Volume 103 (10300-10399)
- Topic: 10370 - Above Average
- Replies: 62
- Views: 29169
- Sat May 07, 2005 6:04 pm
- Forum: Volume 107 (10700-10799)
- Topic: 10763 - Foreign Exchange
- Replies: 45
- Views: 24742
- Sat May 07, 2005 5:27 am
- Forum: Volume 107 (10700-10799)
- Topic: 10763 - Foreign Exchange
- Replies: 45
- Views: 24742
10763 help!
Trying to do the foreign exchange problem
I figured to read in the home and target destinations as 2 seperate arrays, sort them, then compare the results.
Ex:
3
1 2
2 3
3 1
YES
homeArray = {1, 2, 3}
targetArray = {3, 2, 1}
I sort them using merge sort and compare the elements in each, so ...
I figured to read in the home and target destinations as 2 seperate arrays, sort them, then compare the results.
Ex:
3
1 2
2 3
3 1
YES
homeArray = {1, 2, 3}
targetArray = {3, 2, 1}
I sort them using merge sort and compare the elements in each, so ...