Skip to content

Instantly share code, notes, and snippets.

@AlexandruFilipescu
Last active June 9, 2019 16:56
Show Gist options
  • Save AlexandruFilipescu/8bb14d2b1cc0707098b187ffb21405b6 to your computer and use it in GitHub Desktop.
Save AlexandruFilipescu/8bb14d2b1cc0707098b187ffb21405b6 to your computer and use it in GitHub Desktop.
C++ Problema verificare a 2 numere daca se regasesc toate dintr-o cifra, in cealalta(Problem that verifies if a number has the same figures with another number)
#include <iostream>
#include <string>
using namespace std;
int main() {
int n,m,v,w,a,b;
string str;
bool egale;
cin >> n >> m;
v = n;
w = m;
while (n != 0) {
a = n % 10;
egale = false;
while (w != 0) {
b = w % 10;
if (a == b) {
egale = true;
}
w /= 10;
}
w = m;
if (egale == false) {
str = "Numerele nu sunt formate din aceleasi cifre!";
}
else {
str = "Numerele sunt formate din aceleasi cifre!";
}
n /= 10;
}
cout << str;
cout << endl;
system("pause");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment