Nov 9, 2020 at 10:32pm UTC
hello everyone again hhhh =D
in here there is tow line have same link :
https://www.cjoint.com/doc/20_11/JKjwxsY8IYv_newhj.txt
I try find them by this function but I'm very stupid hhhhhhhhh :'(
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
#include <fstream>
#include <iostream>
#include <string>
using namespace std;
int main()
{
std::ifstream if1("newhj.txt" );
std::ifstream if2("newhj1.txt" );
if (!if1.is_open())
return (std::cout << "Cannot open files\n" ), 1;
int cnt1= 0, cnt2=0;
for (std::string f1; std::getline(if1, f1); ++cnt1) {
for (std::string f2; std::getline(if2, f2); ++cnt2){
if (f1 == f2 ){
cout << f1 << endl;
}
}
}
cout << cnt1 << " instances found\n" ;
cout << cnt2 << " instances found\n" ;
}
please anyone can help ❤️ ❤️ ❤️
Last edited on Nov 10, 2020 at 7:44pm UTC
Nov 10, 2020 at 11:06am UTC
I don't understand the requirement - never mind the issue you are having. You provide the contents of newhj.txt file but your code also uses newhj1.txt file?
Would you explain in more detail what you are trying to achieve.
Nov 10, 2020 at 11:10am UTC
@seeplus
No No bro don't care about the names I'm just copy the same file and Rename it by newhj1.txt
There is only one file this is it :
https://www.cjoint.com/doc/20_11/JKjwxsY8IYv_newhj.txt
if you look at my last reply I'm use different names << same.txt >> and << same1.txt>
I'm just try by many method hhh =D
Last edited on Nov 10, 2020 at 11:34am UTC
Nov 10, 2020 at 11:14am UTC
Now I'm very very close to doing it ...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
#include <fstream>
#include <iostream>
#include <string>
using namespace std;
int main()
{
std::ifstream if1("same.txt" );
if (!if1.is_open())
return (std::cout << "Cannot open files\n" ), 1;
int cnt1= 0, cnt2=0, cnt3=0;
string f1, f2, f3;
std::getline(if1, f1);
std::getline(if1, f2);
if ( f1 == f2){
cout << f1 << endl;
}else {
for (f1; std::getline(if1, f3);){
if ( f1 == f3 ){
cout << f1 << endl;
}
f1 = f2 ;
}
}
// cout << cnt1 << " instances found\n" ;
// cout << cnt2 << " instances found\n" ;
}
Last edited on Nov 10, 2020 at 11:17am UTC
Nov 10, 2020 at 3:56pm UTC
wooowooow this for loop should be repeat " 3256220 times " hhhhhhhhhhhhh I think I need super computer =D
is there any other method please ❤️ ❤️ ❤️
Nov 10, 2020 at 6:18pm UTC
If you explain what you're trying to do.......
Nov 10, 2020 at 6:52pm UTC
Last edited on Nov 10, 2020 at 6:52pm UTC
Nov 10, 2020 at 8:02pm UTC
@mbozzi
@seeplus
wooooooooooooowooooooooooowwwwooooooooooooooo Thank you So much brothers this is what I want this link is duplicate :
https://github.githubassets.com/images/icons/emoji/unicode/1f3f3.png
Thanks Thanks Thanks Thanks ❤️ ❤️ ❤️
I'm so sorry my English is not good :'(
but really really I hope be someday professional programmer like you :'(
I was started think it's impossible find it hhhhhhhh =D
Last edited on Nov 10, 2020 at 8:23pm UTC