SHARE
TWEET

Untitled

a guest Nov 9th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "stdfax.h"
  2. #include "stdio.h"
  3. #include "math.h"
  4. #include "stdlib.h"
  5.  
  6.  
  7.  
  8.  
  9.     int perevod210(int a) {
  10.         int s = 0;
  11.         int k = 1;
  12.         while (a != 0) {
  13.             s = a % 10;
  14.             s *= (s * k);
  15.             k *= 2;
  16.             a /= 10;
  17.         }
  18.         return s;
  19.     }
  20.     int perevod102(int a) {
  21.     int s = 0;
  22.     int k = 1;
  23.     while (a != 0) {
  24.         s = a % 2;
  25.         s += (s * k);
  26.         k *= 10;
  27.         a /= 2;
  28.     }
  29.         return s;
  30.     }
  31.     int main() {
  32.         int n, p;
  33.         scanf("%d", &n);
  34.         for (int i = 0; i < n; i++) {
  35.             int z;
  36.             char q;
  37.             scanf("%d %c", &z, &q);
  38.             if (q == '*')
  39.                 p *= perevod210(z);
  40.             else
  41.                 p += perevod210(z);
  42.             printf(perevod102(z));
  43.             return(0);
  44.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top