程序讲解注释#include #includemain(){char dw[][3]={"元","拾","佰","仟",
来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/11/15 13:08:56
程序讲解注释
#include
#include
main()
{char dw[][3]={"元","拾","佰","仟","万","拾","佰","仟","亿","拾","佰","仟","万","拾","佰"};
char dx[10][3]={"零","壹","贰","叁","肆","伍","陆","柒","捌","玖"};
int je,a[17]={0},i,j,k;
printf("请输入一个小写整数金额:\n");
scanf("%d",&je);
i=0;
while(je!=0)
{k=je%10;
a[i]=k;
je=je/10;
i++;
}/*分离出小写金额中的各位数字*/
for(j=i-1;j>=0;j--)
{printf("%s",dx[a[j]]);
printf("%s",dw[j]);
}/*输出大写金额,并且紧跟单位*/
printf("\n");
}
#include
#include
main()
{char dw[][3]={"元","拾","佰","仟","万","拾","佰","仟","亿","拾","佰","仟","万","拾","佰"};
char dx[10][3]={"零","壹","贰","叁","肆","伍","陆","柒","捌","玖"};
int je,a[17]={0},i,j,k;
printf("请输入一个小写整数金额:\n");
scanf("%d",&je);
i=0;
while(je!=0)
{k=je%10;
a[i]=k;
je=je/10;
i++;
}/*分离出小写金额中的各位数字*/
for(j=i-1;j>=0;j--)
{printf("%s",dx[a[j]]);
printf("%s",dw[j]);
}/*输出大写金额,并且紧跟单位*/
printf("\n");
}
#include <stdio.h>
#include <math.h>
int main()
{
//定义单位数组
char dw[][3]={"元","拾","佰","仟","万","拾","佰","仟","亿","拾","佰","仟","万","拾","佰"};
//定义数值转义数组
char dx[10][3]={"零","壹","贰","叁","肆","伍","陆","柒","捌","玖"};
//变量
int je,a[17]={0},i,j,k;
printf("请输入一个小写整数金额:\n");
//获取输入值
scanf("%d",&je);
i=0;
//循环除10获取je的单位
while(je!=0)
{
//余数,根据循环分别代表个位,十位...
k=je%10;
//余数存储在数组中
a[i]=k;
//除10
je=je/10;
//i表示a数组的实际写入长度
i++;
}
/*分离出小写金额中的各位数字*/
for(j=i-1;j>=0;j--)
{
//打印转义字符
printf("%s",dx[a[j]]);
//打印单位
printf("%s",dw[j]);
}
printf("\n");
}
#include <math.h>
int main()
{
//定义单位数组
char dw[][3]={"元","拾","佰","仟","万","拾","佰","仟","亿","拾","佰","仟","万","拾","佰"};
//定义数值转义数组
char dx[10][3]={"零","壹","贰","叁","肆","伍","陆","柒","捌","玖"};
//变量
int je,a[17]={0},i,j,k;
printf("请输入一个小写整数金额:\n");
//获取输入值
scanf("%d",&je);
i=0;
//循环除10获取je的单位
while(je!=0)
{
//余数,根据循环分别代表个位,十位...
k=je%10;
//余数存储在数组中
a[i]=k;
//除10
je=je/10;
//i表示a数组的实际写入长度
i++;
}
/*分离出小写金额中的各位数字*/
for(j=i-1;j>=0;j--)
{
//打印转义字符
printf("%s",dx[a[j]]);
//打印单位
printf("%s",dw[j]);
}
printf("\n");
}
程序讲解注释#include #includemain(){char dw[][3]={"元","拾","佰","仟",
注释一下下面的程序program in C:#include#includevoid main(){char s[]="
C yu yan#include#includemain(){char x[10],y="char";strcmp(x,
有以下程序 #include main() { char c1,c2; scanf("%c",&c1); c2=c1+3
详解下面的程序题.#include void main(){ char *p,*q;p=(char *)malloc(s
C语言中关于画圆程序#include#includemain(){double y;int x,m;for(y=10;y
填写注释语句#include main() { char string[81]; int i,num=0,word=0;
这个程序有什么问题?#include/*void strcpy(char *s,char *t){int i=0;whi
C语言补全程序问题统计一个字符串中单词的个数,单词以一个空格为间隔.#includemain(){char *s="yo
#include "stdio.h" void point(char *p) {p+=3;} main() { char
注释下面代码,#include #include #define N 10void sort (char *pstr[N
#include void main() { char diamond[][5]={{'','','*'},{'','*