Удалить tak3.cpp
This commit is contained in:
28
tak3.cpp
28
tak3.cpp
@@ -1,28 +0,0 @@
|
|||||||
#include <iostream>
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
setlocale(0, "");
|
|
||||||
int n;
|
|
||||||
int x = 0;
|
|
||||||
int m = 1;
|
|
||||||
|
|
||||||
cout << "Введiть цiле число: ";
|
|
||||||
cin >> n;
|
|
||||||
|
|
||||||
int old = n;
|
|
||||||
|
|
||||||
for (int i = n; i > 0; i = i / 10) {
|
|
||||||
int d = i % 10;
|
|
||||||
|
|
||||||
if (d != 3 && d != 6) {
|
|
||||||
x = x + d * m;
|
|
||||||
m = m * 10;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
cout << "Введене число: " << old << endl;
|
|
||||||
cout << "Нове число (без цифр 3 i 6): " << x << endl;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user