问题来了,怎么输入空格?

B2083 画矩形

@[phasetest](/user/410305) 刚刚做出来,感觉还好
by 冰颜布偶喵 @ 2022-01-31 16:29:05


@[phasetest](/user/410305) 建议您不要写那么花
by 冰颜布偶喵 @ 2022-01-31 16:30:44


这些数据里面,f 不一定是 0 和 1 之间的数。 据我猜测,数据中间可能带有其他非ASCII字符,还可能中间穿插EOF。(话说怎么不在输入的字符前面加10个空格。。。) 变量声明位置和读入方法详见各个题解。
by Terrible @ 2022-01-31 16:32:09


@[Terrible](/user/195942) #2 和 #5 这两个数据的点我看都是ASCII 32啊
by phasetest @ 2022-01-31 17:21:53


@[冰颜布偶喵](/user/556653) ![](https://cdn.luogu.com.cn/upload/image_hosting/ngqni0dm.png)
by phasetest @ 2022-01-31 17:35:34


改为 `if (kongs!=0)`
by Terrible @ 2022-01-31 17:43:06


@[Terrible](/user/195942) 懂了,已经全部ac谢谢!
by phasetest @ 2022-01-31 17:56:25


这题很简单啊,我都过了 ```cpp #include<iostream> using namespace std; int a,b,f; char c; int main(){ cin>>a>>b>>c>>f; if(f==1)for(int i=0;i<a;i++){ for(int j=0;j<b;j++)cout<<c; cout<<endl; } else if(f==0){ for(int i=0;i<b;i++)cout<<c; cout<<endl; for(int i=0;i<a-2;i++){ cout<<c; for(int j=0;j<b-2;j++)cout<<' '; cout<<c<<endl; } for(int i=0;i<b;i++)cout<<c; } else for(int i=0;i<a;i++){ for(int j=0;j<b;j++)cout<<c; cout<<endl; } } ```
by wsxbm @ 2022-02-08 16:27:59


上一页 |