#include<stdio.h>
#include<windows.h>
int main(void)
{
char ch;
int blank=0;
int endline=0;
int others=0;
while((ch = getchar())!=‘#‘)
{
if(ch==‘ ‘)
blank++;
else if(ch==‘\n‘)
endline++;
else
others++;
}
printf("%d blank,%d endline,%d others",blank,endline,others);
system("pause");
return 0;
}
#include<stdio.h>
#include<windows.h>
int main(void)
{
int odd_sum=0;
int even_sum=0;
int odd_count=0;
int even_count=0;
int odd_ave,even_ave;
int input;
while(scanf("%d",&input))
{
if(input==0)
break;
if(input%2==0)
{
even_sum+=input;
even_count++;
even_ave=even_sum/even_count;
}
else{
odd_sum+=input;
odd_count++;
odd_ave=odd_sum/odd_count;
}
}
printf("Have %d even number,average is %d.\n",even_count,even_ave);
printf("Have %d odd number,average is %d.\n",odd_count,odd_ave);
printf("Well done!\n");
system("pause");
return 0;
}
/*30小时内无加班,标准基础税率
a:基本工资=10.00美元一小时
b:加班(工作时间超过40小时)=按1.5倍的时间计算
c:税率:前300美元为15%;接下来的150美元为20%;余下的为25%。*/
原文:https://www.cnblogs.com/jyyofficial/p/14745553.html