蛋白免疫印迹的原理:有两个C++小程序要编,老弟实在搞不定,不知大家可否援助一下??谢了!!!

来源:百度文库 编辑:高考问答 时间:2024/04/29 07:59:24
1,形成一个5行5列的矩阵,要求两条对角线的元素均为1,其余元素为0;

2,输入 N个数,找出所有大于N个数的平均值的那些数及最小数。

真的很急,谢谢大家了!!!

第一题:
int i,j;

for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
{
if(i==j)cout<<1;
else cout<<0;
}
}
第二题:
double a[100];
int n;
double min;
double sum=0;
cout<<"请输入n的值:"<<endl;
cin>>n;
cout<<"请输入"<<n<<"个数"<<endl;
for(int j=0;j<n;j++)
{
cin>>a[j];
sum=sum+a[j];
}
sum=sum/n;
cout<<"所有大于平均值的数:"<<endl;
for(j=0;j<n;j++)
{
if(a[j]>sum)cout<<a[j]<<" ";
}
cout<<"最小数:"<<endl;
min=a[0];
for(j=1;j<n;j++)
{
if(min>a[j])min=a[j];
}
cout<<min;

cout<<1<<" "<<0<<" "<<0<<" "<<0<<" "<<1<<endl;
cout<<0<<" "<<1<<" "<<0<<" "<<1<<" "<<0<<endl;
cout<<0<<" "<<0<<" "<<1<<" "<<0<<" "<<0<<endl;
cout<<0<<" "<<1<<" "<<0<<" "<<1<<" "<<0<<endl;
cout<<1<<" "<<0<<" "<<0<<" "<<0<<" "<<1<<endl;

什么题目啊?!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!