目录
B2002 Hello,World!
题目描述
编写一个能够输出
Hello,World!
的程序。提示:
- 使用英文标点符号;
Hello,World!
逗号后面没有空格。H
和W
为大写字母。输入格式
无
输出格式
无
输入输出样例
输入 #1
无输出 #1
Hello,World!
源代码:
#include<iostream>
using namespace std;
int main(){
cout<<"Hello,World!"<<endl;
return 0;
}
B2025 输出字符菱形
题目描述
用
*
构造一个对角线长 55 个字符,倾斜放置的菱形。输入格式
没有输入要求。
输出格式
如样例所示。用
*
构成的菱形。输入输出样例
输入 #1
输出 #1
* *** ***** *** *
源代码:
#include<iostream>
using namespace std;
int main(){
for(int i=1;i<=3;i++){
for(int j=i;j<3;j++) cout<<" ";
for(int j=1;j<=i*2-1;j++){
cout<<"*";
}
cout<<endl;
}
for(int i=2;i>=1;i--){
for(int j=i;j<3;j++) cout<<" ";
for(int j=1;j<=i*2-1;j++){
cout<<"*";
}
cout<<endl;
}
return 0;
}
P1000 超级玛丽游戏
题目背景
本题是洛谷的试机题目,可以帮助了解洛谷的使用。
另外强烈推荐新用户必读贴
题目描述
超级玛丽是一个非常经典的游戏。请你用字符画的形式输出超级玛丽中的一个场景。
******** ************ ####....#. #..###.....##.... ###.......###### ### ### ........... #...# #...# ##*####### #.#.# #.#.# ####*******###### #.#.# #.#.# ...#***.****.*###.... #...# #...# ....**********##..... ### ### ....**** *****.... #### #### ###### ###### ############################################################## #...#......#.##...#......#.##...#......#.##------------------# ###########################################------------------# #..#....#....##..#....#....##..#....#....##################### ########################################## #----------# #.....#......##.....#......##.....#......# #----------# ########################################## #----------# #.#..#....#..##.#..#....#..##.#..#....#..# #----------# ########################################## ############
输入格式
无
输出格式
如描述
输入输出样例
无
源代码:
#include <iostream>
using namespace std;
int main(){
cout<<" ********"<<endl;
cout<<" ************"<<endl;
cout<<" ####....#."<<endl;
cout<<" #..###.....##...."<<endl;
cout<<" ###.......###### ### ###"<<endl;
cout<<" ........... #...# #...#"<<endl;
cout<<" ##*####### #.#.# #.#.#"<<endl;
cout<<" ####*******###### #.#.# #.#.#"<<endl;
cout<<" ...#***.****.*###.... #...# #...#"<<endl;
cout<<" ....**********##..... ### ###"<<endl;
cout<<" ....**** *****...."<<endl;
cout<<" #### ####"<<endl;
cout<<" ###### ######"<<endl;
cout<<"##############################################################"<<endl;
cout<<"#...#......#.##...#......#.##...#......#.##------------------#"<<endl;
cout<<"###########################################------------------#"<<endl;
cout<<"#..#....#....##..#....#....##..#....#....##################### "<<endl;
cout<<"########################################## #----------#"<<endl;
cout<<"#.....#......##.....#......##.....#......# #----------#"<<endl;
cout<<"########################################## #----------#"<<endl;
cout<<"#.#..#....#..##.#..#....#..##.#..#....#..# #----------#"<<endl;
cout<<"########################################## ############"<<endl;
return 0;
}
P1001 A+B Problem
题目背景
强烈推荐新用户必读帖。不熟悉算法竞赛的选手请看这里:
算法竞赛中要求的输出格式中,不能有多余的内容,这也包括了“请输入整数 \bm aa 和 \bm bb” 这一类的提示用户输入信息的内容。若包含了这些内容,将会被认为是 Wrong Answer,即洛谷上的 WA。在对比代码输出和标准输出时,系统将忽略每一行结尾的空格,以及最后一行之后多余的换行符。
若因此类问题出现本机(看起来)AC,提交 WA 的现象,请勿认为是洛谷评测机出了问题,而是你的代码中可能存在多余的输出信息。用户可以参考在题目末尾提供的代码。
另外请善用应用中的在线 IDE 功能,以避免不同平台的评测中所产生的一些问题。
还有一点很重要的是,请不要在对应的题目讨论区中发布自己的题解,请发布到题解区域中,否则将处以删除或禁言的处罚。若发现无法提交题解则表明本题题解数量过多,仍不应发布讨论。
题目描述
输入两个整数 a, ba,b,输出它们的和(|a|,|b| \le {10}^9∣a∣,∣b∣≤10
9
)。注意
Pascal 使用 integer 会爆掉哦!
有负数哦!
C/C++ 的 main 函数必须是