fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // Introduc variabilele a, b, c şi x;
  6. int a, b, c, x;
  7. // Citesc a, b, c, x;
  8. cin >> a >> b >> c >> x;
  9. if (c == x % 10) {
  10.  
  11.  
  12. // Introduc variabila “cnt” sa numar cifrele;
  13. int cnt = 0;
  14. // parcurg x;
  15. while (x > 0) {
  16. ++cnt;
  17. x /= 10;
  18.  
  19. }
  20. //if (x == b)
  21. cout << x;
  22. }
  23. // Daca “cnt” egal cu 1 si daca rest egal cu b;
  24. //Daca “cnt” egal cu a si rest egal cu c;
  25. //Afisez DA daca e diferit, afisez NU;
  26. return 0;
  27. }
Success #stdin #stdout 0s 5320KB
stdin
6 4 3 489643
stdout
Standard output is empty