MUstar

IoT C언어 0703 - EX_03 (줄압축)

Jul 3rd, 2017
76
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5.     int num[10], plus = 0 ,cnt=0, ec=0, res;
  6.     while(1)
  7.     {
  8.         res = getchar(); if(res==10) break;
  9.         else{num[cnt] = res - 48; cnt++;}
  10.     }
  11.     while(2)
  12.     {
  13.         int digi=1, i=1;
  14.         if(cnt>1) {cnt--; while(3){digi = digi * 10; if(i==cnt) break; else i++;} plus = digi * num[ec] + plus; ec++;}
  15.         else {plus = plus + num[ec]; break;}
  16.     }
  17.     printf("%d\n", plus+10); return 0;
  18. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×