online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include<stdio.h> #include<string.h> int func(char c1[],int won,int bug) { int lad=0; if(won>20) lad=650+bug; else if(won>0) lad=670-won+bug; int k=(lad/400); int l=(lad/200); if(!(strcmp(c1,"INDIAN"))) return l; else if(!(strcmp(c1,"NON_INDIAN"))) return k; } int main() { int t; scanf("%d",&t); for(int j=1;j<=t;j++) { char c1[10]; int s1=0,s2=0,won=0,bug=0,org,c=0; scanf("%d%s",&org,&c1[0]); while(1) { char c2[11],c3[15],c4[9],c5[14]; scanf("%s%d",&c2[0],&won); s1+=won; c++; if(c==org) { printf("%d",func(c1,s1,s2)); break; } scanf("%s",&c3[0]); c++; if(c==org) { printf("%d",func(c1,s1,s2)); break; } scanf("%s%d",&c4[0],&bug); s2+=bug; c++; if(c==org) { printf("%d",func(c1,s1,s2)); break; } scanf("%s",&c5[0]);c++; if(c==org) { printf("%d",func(c1,s1,s2)); break; } } } return 0; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue