汪磊


私信TA

用户名:haikuotiankong

访问量:39974

签 名:

等  级
排  名 198
经  验 6446
参赛次数 2
文章发表 53
年  龄 0
在职情况 学生
学  校 河南农业大学
专  业

  自我简介:

#include<iostream>
using namespace std;
int main(){
    int m,n;
    cin>>m>>n;
    for(int i=0;i<2*m+1;i++){
        if(m==0||n==0){
            break;
        }
        if(i%2==0){
            cout<<"+";
            for(int j=0;j<n;j++){
                cout<<"-+";
            }
            cout<<endl;
        }
        else{
            cout<<"|";
            for(int j=0;j<n;j++){
                cout<<" |";
            }
            cout<<endl;
        }
    }
    return 0;
}


 

0.0分

10 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换

万能编程问答  

代码解释器

代码纠错

SQL生成与解释

  评论区

#include <algorithm>
#include <iostream>
#include <stdio.h>
using namespace std;
int main()
{
	int n,m;
	cin>>n>>m;
	if(n==0||m==0) return 0;
	printf("+");
	for(int i=0;i<m;i++)
		printf("-+");
	printf("\n");
	
	for(int i=0;i<n;i++){
		cout<<'|';
		for(int j=0;j<m;j++)
			printf(" |");
		cout<<endl;
		printf("+");
		for(int j=0;j<m;j++)
			printf("-+");
		printf("\n");
	}
	return 0;
}

我这个哪有问题?
2019-01-19 17:28:44
  • «
  • 1
  • »