Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define int long long
- signed main()
- {
- ios_base::sync_with_stdio(0);
- cin.tie(0);
- // A
- /*
- int a , b;
- cin >> a >> b;
- int i = a;
- while(i <= b){
- cout << i << " ";
- i++;
- }
- */
- // B
- /*
- int n , cnt = 0;
- cin >> n;
- if(n == 0){
- cout << 1;
- return 0;
- }
- while(n){
- cnt++;
- n /= 10;
- }
- cout << cnt;
- */
- // C
- /*
- int n , sum = 0;
- cin >> n;
- n = abs(n);
- while(n){
- sum += n % 10;
- n /= 10;
- }
- cout << sum;
- */
- // D
- /*
- long long n , odd = 0;
- cin >> n;
- while(n){
- odd += n % 2;
- n /= 10;
- }
- cout << odd;
- */
- // E
- /*
- int n , p = 1;
- cin >> n;
- while(n){
- if(n % 10)
- p *= n % 10;
- n /= 10;
- }
- cout << p;
- */
- // F
- /*
- int n , p = 1;
- cin >> n;
- n = abs(n);
- if(n == 0){
- cout << 0;
- return 0;
- }
- while(n){
- if(n % 2 == 0)
- p *= n % 10;
- n /= 10;
- }
- if(p == 1)
- cout << "-1";
- else
- cout << p;
- */
- // G
- /*
- int n , mx = 0;
- cin >> n;
- while(n != 0){
- mx = max(mx , n % 10);
- n /= 10;
- }
- cout << mx;
- */
- // H
- /*int n , mx = 0;
- cin >> n;
- int old = n;
- while(n != 0){
- mx = max(mx , n % 10);
- n /= 10;
- }
- n = old;
- int cnt = 0;
- while(n){
- if(n % 10 == mx)
- cnt++;
- n /= 10;
- }
- cout << cnt;
- */
- // H
- /*
- int n , mx = 0 , cnt = 0;
- cin >> n;
- while(n){
- int d = n % 10;
- if(mx < d){
- mx = d;
- cnt = 0;
- }
- if(mx == d)
- cnt++;
- n /= 10;
- }
- cout << cnt;
- */
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement