Tag: problem: (G) BF Calculator Solution in C/C++

April Fools Contest 2017, problem: (G) BF Calculator Solution in C/C++

#include<cstdio> int main() { int ans=0,a=0; char c; scanf(“%d”,&ans); while (scanf(“%c%d”,&c,&a) != EOF) { if (c==’+’) ans+=a; if (c==’-‘) ans-=a; } a=0; if (ans==0) { printf(“++++++++++++++++++++++++++++++++++++++++++++++++.”); return 0; } while (ans) { int x=ans%10; for (int...

Want to stay up to date with the latest news?

We would love to hear from you! Please fill in your details and we will stay in touch. It's that simple!