随便什么语言 只要能帮我运算出来 谢谢帮忙啊

来源:百度知道 编辑:UC知道 时间:2024/06/11 23:42:36
各位前辈帮帮忙
可以帮我编出这个程序吗?

有1到12列 A B C三行
如下:
1 2 3 4 5 6 7 8 9 10 11 12
A
B
C
A行任意填写数字(大于3,小于48),一个12个
B行运算出相对应的数值(大于1,小于99)
C行是每列A和B的乘积

要求在A行12个数字确定后,运行后,C行任一个数值都大于B行的总和

我弄了好头疼 感觉会不会是个死程序啊?
还请各位前辈帮忙 这是我抽中的考试题目
谢谢各位帮忙啊
晚生感激不尽

import java.util.Random;

public class Test
{

public int a[]=new int[12];
public int b[]=new int[12];
public int c[]=new int[12];

public static void main(String[] args)
{
int i=0,n,m=0,j=0;
Test t=new Test();

Random rd=new Random();

i=0;
while(i<=11)
{
boolean bl=false;
t.a[i]=40;//rd.nextInt(44)+4;
t.b[i]=rd.nextInt(98)+1;
m=m+t.b[i];
t.c[i]=t.a[i]*t.b[i];
i++;
if(i>11)
{
System.out.println("m="+m+" 运算次数:"+j++);
for(i=0;i<=11;i++)
{
if(t.c[i]<m)
{
bl=true;
}

}
if(bl)
{
i=0;
m=0;

}

}
}
for(i=0;i<=11;i++)
{
System.out.println("c["+i+"]="+t.c[i]);
}

System.