本文介绍了无效的间接运算符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想显示每个销售人员的总销售额,工资,并确定以下类别中的工资收入
$ 100- $ 500
$ 501-900 $
$ 900以上。
每个销售人员(有10个)收到100美元加上他的总sasles的10%
I wanted to display the gross sales, salary of each salesperson and determine how many earned salaries in the following categories
$100-$500
$501-900$
$900-above.
Each salesperson(there are 10) receives $100 plus 10% of his gross sasles
#include<iostream.h>
#include<stdio.h>
#include<conio.h>
int main(){
clrscr();
int gross_sale[10],i,salary ;
int ctr1=0,ctr2=0,ctr3=0,r1=5,r2=5,r3=5;
printf("ENTER GROSS SALES\n");
for(i=0;i<10;i+1){
printf("Salesperson %d: ",i++);
scanf("%d",gross_sale[i]);
}
clrscr();
salary=100+gross_sale[i]/10;
for(i=0;i<10;i++){
if (salary<500 && salary>100)
{
gotoxy(10,r1); printf("Salesperson %d : %d",i+1, salary);
r1++;ctr1++;
}
else if (salary >= 501 && salary <=900){
gotoxy(35,r2); printf("Salesperson %d : %d",i+1,salary);
r3++;ctr3++;
}
else
{
gotoxy(60,r3); printf("Salesperson%d: %d",i+1,salary);
r3++;ctr3++;
}
printf("\n\n\n");
printf("Salesperson who earned salaray from $900-and better %d\n",ctr1);
printf("Salesperson who earned salaray from $500-$900 %d\n",ctr2);
printf("Salesperson who earned salaray from $100-$500 %d\n",ctr3);
gotoxy(24,1);
printf("SALARY CATEGORIES\n");
printf("\n[$100-$500]\t\t[$501-$900]\t\t[$901 and better]");
getch();
return 0;
}
}
</conio.h></stdio.h></iostream.h>
推荐答案
这篇关于无效的间接运算符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!