Forums

Forums (http://www.abandonia.com/vbullet/index.php)
-   Programming (http://www.abandonia.com/vbullet/forumdisplay.php?f=25)
-   -   A Problem (http://www.abandonia.com/vbullet/showthread.php?t=3920)

NrmMyth 20-03-2005 04:13 PM

So I'm solving one problem from internet and when I post my code to verify it I get a mistake in output. But everything would be nice if the output wasn't 10 (A4) pages long.
I have the correct output and my one. By looking at them they are indentical.
Now I ask you "fighters of abandonia" for help.
I need to find (probably) one line of output that is different from te correct one.
Help me! Anything could help me.
... On the other hand I could write a program.
muck...
...I think I will write a program...
Anyway thanks.
Still it would be great to have some program that can tell the difference between documents.
:blink: No need now for this topic. LOL

Data 20-03-2005 04:56 PM

try diff
it's an application to compare files

Jim6 20-03-2005 07:11 PM

Here ya go - it's quick and nasty though!


#include <iostream>
#include <fstream>
using namespace std;

int main() {
string filename1,filename2;
cout<<"File one: ";
cin>>filename1;
ifstream inone(filename1.c_str());
cout<<"File two: ";
cin>>filename2;
ifstream intwo(filename2.c_str());
string a,b;
int n = 0;
while ((!inone.eof()) && (!intwo.eof())) {
getline(inone,a);
getline(intwo,B);
n++;
if (a != B) {
cout<<"There was a discongruity on line: "<<n<<"\n";
}
}
return 0;
}

Edit: Ugh... lost all my formatting...
Edit2: Ugh... it turned my code into smileys!

NrmMyth 20-03-2005 08:37 PM

Quote:

Originally posted by Jim6@Mar 20 2005, 08:11 PM
Here ya go - it's quick and nasty though!
...

Thanks for a try but I already did my own program in.
It looks very much like yours.
Anyway thanks again.

BTW: Kon-tiki, you can delete this topic becouse it's stupid, and there is no use of it .
I was very stupid to start this topic when I did my own "difference" program ten minutes later. :wall: LOL LOL LOL

NrmMyth 20-03-2005 09:22 PM

@Jim6
Have seen your signature link, nice story. LOL

Jim6 21-03-2005 12:17 AM

Well, whatever - I just made it because I was bored.

Also, yeah - I thought it was really good - if a bit weird!

NrmMyth 21-03-2005 06:54 PM

Quote:

Originally posted by Jim6@Mar 21 2005, 01:17 AM
Well, whatever - I just made it because I was bored.

Also, yeah - I thought it was really good - if a bit weird!

Yeah... LOL


The current time is 01:16 PM (GMT)

Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.