Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <sstream>
- #include <fstream>
- #include "BigNumber.h"
- using namespace std;
- long long toLL(string s)
- {
- stringstream ss;
- ss << s;
- long long n;
- ss >> n;
- return n;
- }
- int main()
- {
- ifstream casos("casosCorrectitud.txt");
- int cant;
- casos >> cant;
- int fallidos = 0;
- for(int i=0; i<cant; i++)
- {
- string a, b;
- long long la, lb;
- casos >> a >> b;
- BigNumber na(a);
- BigNumber nb(b);
- la = toLL(a);
- lb = toLL(b);
- BigNumber resBN = na*nb;
- long long resLL = la*lb;
- if(toLL(resBN.toStr()) != resLL)
- {
- fallidos++;
- }
- }
- cout << "Fallidos: " << fallidos << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement