Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma GCC optimize("O3")
- #include <bits/stdc++.h>
- using namespace std;
- #define int long long
- #define double long double
- #define endl '\n'
- #define fastio ios_base::sync_with_stdio(0); cin.tie(0)
- signed main()
- {
- fastio;
- int n;
- cin >> n;
- n = abs(n);
- int m = 0; // tersine
- int cnt = 0; // reqem sayi
- int sum = 0; // reqem cemi
- int hasil = 1; // reqemlerin hasili
- int x = 9; // min reqem, baslayanda 9 la
- int y = 0; // max reqem, baslayanda 0 la
- while(n){
- int d = n % 10;
- m = m * 10 + d;
- cnt++;
- sum += d;
- hasil *= d;
- x = min(x , d);
- y = max(y , d);
- n /= 10;
- }
- // -94582
- cout << "Tersine: " << m << '\n'; // 28549
- cout << "Say: " << cnt << '\n'; // 5
- cout << "Cem: " << sum << '\n'; // 28
- cout << "Hasil: " << hasil << '\n'; // 2880
- cout << "Min: " << x << '\n'; // 2
- cout << "Max: " << y << '\n'; // 9
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement