如果每个老师的工资额都知道,最少需要准备多少张人民币,才能在给每位老师发工资的时候都不用老师找零呢?
#include <stdio.h>
int main()
{
int n,s[6],a,i;
while (scanf("%d",&n)&&n)
{
for (i=0;i<n;i++)
{
scanf("%d",&s[i]);
a=s[i]/100;
a=a+s[i]%100/50;
a=a+s[i]%100%50/10;
a=a+s[i]%100%50%10/5;
a=a+s[i]%100%50%10%5/2;
a=a+s[i]%100%50%10%5%2/1;
}
printf("%d\n",a);
}
return 0;
}
笟
浏览 1891回答 3
3回答
-
如果没有如果5
需要小改一下
#include <stdio.h> int main() { int n,s[6],a=0,i; while (scanf("%d",&n)&&n) { for (i=0;i<n;i++) { scanf("%d",&s[i]); a+=s[i]/100; a=a+s[i]%100/50; a=a+s[i]%100%50/10; a=a+s[i]%100%50%10/5; a=a+s[i]%100%50%10%5/2; a=a+s[i]%100%50%10%5%2/1; } printf("%d\n",a); } return 0; }
-
慕的地8582982
ADNUSJHJBHPGCSZVLWMFWXSGXKEESBUYVFRYWWJGYXUKLGVOVEHODVYUJANGQEYMCXRQDYTTKRYYPCHEHLLRHAOLGCJGAUOOOURPKOVAXHEXUVUHAAERXXFFZKQNPZWXRRYEDGEDNXDGPXHLXUKMVMQFFAYXDMTQZWVDGNPHKTTTJVCFLHIFZIJQCBLIUHXXHXGMMTFLIMXICSLSLPVYWVFPIOLLXZWCWWGNAIFNXYLEVFQOFSUEURRHIYERSRYHVVVOLHEPGLFHHSPFRIOYUYMYYQINARHDNXURXXUWVKYROOVRURAUPUENBFPNAOJSNOXASDZQTWIEBRHBBSROJQOOYPPCTSGNHJZJHQMDZJZKGPUWZCSPZPDMXUWTQNQAJFBRUENLNDZJHWSNDAKIKAXQLAXHXNQSILWLBYHKAWFIYEKHXKUEKDBQDZRHRKUBAAKQFADBDMPGGKIEEPMNHFTPUQSPLCLBZZSKSOUIVFZCIFWGOYHKGHYURBWYGCFQLOYIEAJTPMJFPSPMGOLNDBKBKTKJYYMTQONDWQUCZWEBKNPNCZUXKADOIOZFOHHUNIYYBRVOAEHAYESIVODQWJEKJZTTTZJEADBLRRUMDTNPQNBYIRLJLAXAJTQTCMJLBKHEBILHKQMKUDTDNIZCLHLBROXTPSPDMKZQGBRMCZFVGOUPBMZZTAYPPICMDNMJJWAOOLBYHYSQZBGUKAQLBREBFVTJFGWFWNNYHQGKGISBLNRIENWZIEPIDFJSCZIFIYTJLIYBQTVSORNJXTEBXNDAFCTJGWMHQAKVEUYBKPFVFIWSBLGWMCLHKYCPLIPKXTLBOEUSVYVRNRANWNDAPTQMIFMBLOLHKGPLIJZVZCGOKTJT
-
程序猿天璇
这不是代码都有了吗 运行通过不就行了
打开App,查看更多内容