编辑代码

#include <stdio.h>
int main () 
{
    //JSRUN引擎2.0,支持多达30种语言在线运行,全仿真在线交互输入输出。 
	int ctr;
    int idSearch;
    int found=0;
    int custID[10]={313,453,502,101,892,
                    475,792,912,343,633};
    float custBal[10]={ 0.00, 45.43, 71.23, 301.56, 9.08,
                        192.41, 389.00, 229.67, 18.31, 59.54};
    
    printf("\n\n*** Customer Balance Lookup ***\n");
    printf("What is the customer number? ");
    scanf("  %d",&idSearch);

    for (ctr=0;ctr<10;ctr++)
    {
        if (idSearch==custID[ctr])
        {
            found=1;
            break;
        }
    }

    if (found)
    {
        if (custBal[ctr]>100)
        {
            printf("\n** That customer's balance is $%.2f.\n",custBal[ctr]);
            printf("    No credit!\n");
        }
        else 
        {
            printf("\n**The customer's credit is good !\n");
        }
    }
    else
    {
        printf("**You must have typed an incorrect customer ID.");
    }
    //printf("Hello JSRUN!   \n\n         - from C .");
	return 0;
}