Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdfax.h"
- #include "stdio.h"
- #include "math.h"
- #include "stdlib.h"
- int perevod210(int a) {
- int s = 0;
- int k = 1;
- while (a != 0) {
- s = a % 10;
- s *= (s * k);
- k *= 2;
- a /= 10;
- }
- return s;
- }
- int perevod102(int a) {
- int s = 0;
- int k = 1;
- while (a != 0) {
- s = a % 2;
- s += (s * k);
- k *= 10;
- a /= 2;
- }
- return s;
- }
- int main() {
- int n, p;
- scanf("%d", &n);
- for (int i = 0; i < n; i++) {
- int z;
- char q;
- scanf("%d %c", &z, &q);
- if (q == '*')
- p *= perevod210(z);
- else
- p += perevod210(z);
- printf(perevod102(z));
- return(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement