您好,欢迎来到品趣旅游知识分享网。
搜索
您的当前位置:首页慧通教育C++测试题 103667--103673(5题)

慧通教育C++测试题 103667--103673(5题)

来源:品趣旅游知识分享网
//103667.求最大值 难度:1
#include<bits/stdc++.h>
using namespace std;
int ans=0,n,m,q,a[105][105];
int main(){
	cin>>n>>m>>q;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=m;j++){
			cin>>a[i][j];
		}
	}
	int x1,x2,y1,y2;
	while(q--){
		ans=-1;
		cin>>x1>>y1>>x2>>y2;
		for(int i=x1;i<=x2;i++){
			for(int j=y1;j<=y2;j++){
				ans=max(a[i][j],ans);
			}
		}
		cout<<ans<<endl;
	}
    return 0;
}


103670.打印九九乘法表 难度:1

#include<bits/stdc++.h>
using namespace std;
int main(){
    for(int i=1;i<=9;i++){
        for(int j=1;j<=i;j++){
            printf("%d*%d=%d ",i,j,i*j);
        }
        cout<<'\n';
    }
    return 0;
}



103671.计算阶乘 难度:1

//103671.计算阶乘 难度:1
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    long long ans=0,t=1;
    cin>>n;
    for(int i=1;i<=n;i++){
        t*=i;
        ans+=t;
    }
    cout<<ans;
    return 0;
}


103672.图形输出 难度:1

//103672.图形输出 难度:1
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin>>n;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=i;j++){
            cout<<j<<" ";
        }
        cout<<endl;
    }
    return 0;
}



103673.图形输出2 难度:1

//103673.图形输出2 难度:1
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin>>n;
    for(int i=1;i<=n;i++){
        for(int j=i;j<i+n;j++){
            cout<<j<<" ";
        }
        cout<<'\n';
    }
    return 0;
}



 

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- pqdy.cn 版权所有 赣ICP备2024042791号-6

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务