洛谷 贴代码

这次我专门找了几道超级水的水题!(如Hello world)不细讲,就贴个代码!

首先先看一下是哪几道(共10道,算多的):

1.B2001 入门测试题目

2.B2002 Hello,World!

3.B2003 输出第二个整数 

4.B2004 对齐输出

5.B2005 字符三角形

6.B2007 A + B 问题

7.B2008 计算 (a+b)×c 的值

8.B2009 计算 (a+b)/c 的值 

9.B2010 带余除法

10.B2011 计算分数的浮点数值

OK,开始正文!(由于题目太多,我就不放题目了,需要的可以点进去看看)

第1道:

#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long a,b;
    cin >> a >> b;
    cout<<a+b;
	return 0;
}

第2道:

#include<bits/stdc++.h>
using namespace std;
int main()
{
	cout<<"Hello,World!";
	return 0;
}

第3道:

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,c;
    cin >> a >> b >> c;
    cout<<b;
	return 0;
}

第4道:

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,c;
    cin >> a >> b >> c;
    printf("%8d %8d %8d",a,b,c);
	return 0;
}

第5道:

#include<bits/stdc++.h>
using namespace std;
int main()
{
	char c;
    cin >> c;
    cout<<"  "<<c<<endl<<" "<<c<<c<<c<<endl<<c<<c<<c<<c<<c;
	return 0;
}

第6道:

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b;
    cin >> a >> b;
    cout<<a+b;
	return 0;
}

第7道:

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,c;
    cin >> a >> b >> c;
    cout<<(a+b)*c;
	return 0;
}

第8道:

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,c;
    cin >> a >> b >> c;
    cout<<(a+b)/c;
	return 0;
}

第9道:

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b;
    cin >> a >> b;
    cout<<a/b<<" "<<a%b;
	return 0;
}

第10道:

#include<bits/stdc++.h>
using namespace std;
int main()
{
	double a,b;
    cin >> a >> b;
    printf("%.9lf",a/b);
	return 0;
}

这篇博客就到这里啦(之后如果有水题的话,我应该也会这样的),我们下篇再见!

洛谷 P1000 题目描述: 请输出一行字符画,其中包含了洛谷的网址(luogu.org)。 样例输出: ``` ******** ************ ####....#. #..###.....##.... ###.......###### ### ### ........... #...# #...# ##*####### #.#.# #.#.# ####*******###### #.#.# #.#.# ...#***.****.*###.... #...# #...# ....**********##..... ### ### ....**** *****.... #### #### ###### ###### ############################################################## #...#......#.##...#......#.##...#......#.##------------------# ###########################################------------------# #..#....#....##..#....#....##..#....#....##################### ########################################## #----------# #.....#......##.....#......##.....#......# #----------# ########################################## #----------# #.#..#....#..##.#..#....#..##.#..#....#..# #----------# ########################################## ############ ``` 代码实现: ```c++ #include <iostream> using namespace std; int main() { cout << " ********\n" " ************\n" " ####....#.\n" " #..###.....##....\n" " ###.......###### ### ###\n" " ........... #...# #...#\n" " ##*####### #.#.# #.#.#\n" " ####*******###### #.#.# #.#.#\n" " ...#***.****.*###.... #...# #...#\n" " ....**********##..... ### ###\n" " ....**** *****....\n" " #### ####\n" " ###### ######\n" "##############################################################\n" "#...#......#.##...#......#.##...#......#.##------------------#\n" "###########################################------------------#\n" "#..#....#....##..#....#....##..#....#....#####################\n" "########################################## #----------#\n" "#.....#......##.....#......##.....#......# #----------#\n" "########################################## #----------#\n" "#.#..#....#..##.#..#....#..##.#..#....#..# #----------#\n" "########################################## ############\n" " luogu.org\n"; return 0; } ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值