你的程序有很多不对的地方,没必要用数组,多次的getchar()也不知道是干啥的,我写一个程序贴给你看看吧,有问题再问。
#include<stdio.h>
void judge_num(int num)
void split_num(int num)
int main()
{
int num=0
printf("请输入一个整数:")
scanf("%d",&num)
if(num<0)
{
printf("fu ")
num=-num
}
split_num(num)
printf("\n")
return 0
}
void judge_num(int num)
{
switch(num)
{
case 0: printf("ling ")break
case 1: printf("yi ")break
case 2: printf("er ")break
case 3: printf("san ")break
case 4: printf("si ")break
case 5: printf("wu ")break
case 6: printf("liu ")break
case 7: printf("qi ")break
case 8: printf("ba ")break
case 9: printf("jiu ")break
}
}
void split_num(int num)
{
int n
if((n=num/10)!=0)
split_num(n)
judge_num(num%10)
}
public class MultiplyTest{
public static void main(String[] args){
for(int i = 1i <= 9i++){
for(int j = 1j <= ij++){
System.out.print(new Member(i, j))
}
System.out.println()
}
}
}
class Member{
int num1
int num2
public Member(int num1, int num2){
this.num1 = num1
this.num2 = num2
}
public String toString(){
return num1 + "*" + num2 + "=" + num1* num2 + "\t"
}
}
手工写的请采纳
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)