Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- bool spr(int pierwsza, int druga){
- string abc ="0123456789";
- int counter1 = 0;
- int counter2 = 0;
- string p = to_string(pierwsza);
- string d = to_string(druga);
- for(int i = 0; i < 10; i++){
- counter1 = 0;
- counter2 = 0;
- cout <<"i=";
- cout<<i<<endl;
- for(int j = 0; j < p.length(); j++){
- if(p[j] == abc[i]){
- counter1++;
- }
- }
- for(int k = 0; k < d.length(); k++){
- if(d[k] == abc[i]){
- counter2++;
- }
- }
- cout<<"counter1 ";
- cout<<counter1<<endl;
- cout<<"counter2 ";
- cout<<counter2<<endl;
- if(counter1!=counter2){
- return false;
- }
- }
- return true;
- }
- int main()
- {
- int pierwsza;
- cin >> pierwsza;
- int druga;
- cin >> druga;
- if(spr(pierwsza, druga)){
- cout << "GICIOR" << endl;
- }
- else{
- cout << "DUPA" << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement