problemscpp
A collection of my answers to algorithm problems in c++.
静态 Public 成员函数 | 所有成员列表
luogu::P2433类 参考

洛谷 P2433 【深基1-2】小学数学 N 合一 更多...

#include <luogu.h>

静态 Public 成员函数

static int main (istream &cin, ostream &cout)
 

详细描述

洛谷 P2433 【深基1-2】小学数学 N 合一

在文件 luogu.h78 行定义.

成员函数说明

◆ main()

int luogu::P2433::main ( istream &  cin,
ostream &  cout 
)
static

在文件 luogu.cpp217 行定义.

217 {
218 int T;
219 cin >> T;
220 if(T == 1) {
221 cout << "I love Luogu!";
222 } else if(T == 2) {
223 cout << 2 + 4 << " " << 10 - 2 - 4;
224 } else if(T == 3) {
225 cout << 14 / 4 << endl
226 << 14 / 4 * 4 << endl
227 << 14 % 4;
228 } else if(T == 4) {
229 cout << setiosflags(ios::fixed) << setprecision(3) << 500.0 / 3.0;
230 } else if(T == 5) {
231 cout << (260 + 220) / (12 + 20);
232 } else if(T == 6) {
233 cout << sqrt(6 * 6 + 9 * 9);
234 } else if(T == 7) {
235 int deposit = 100;
236 deposit += 10;
237 cout << deposit << endl;
238 deposit -= 20;
239 cout << deposit << endl;
240 deposit = 0;
241 cout << deposit << endl;
242 } else if(T == 8) {
243 cout << 2 * 5 * 3.141593 << endl;
244 cout << 5 * 5 * 3.141593 << endl;
245 cout << 4 * 5 * 5 * 5 * 3.141593 / 3 << endl;
246 } else if(T == 9) {
247 const int peach = 1;
248 cout << (((peach + 1) * 2 + 1) * 2 + 1) * 2;
249 } else if(T == 10) {
250 cout << 90 / 10;
251 } else if(T == 11) {
252 cout << 100.0 / 3.0;
253 } else if(T == 12) {
254 cout << 'M' - 'A' + 1 << endl;
255 cout << static_cast<char>('A' - 1 + 18);
256 } else if(T == 13) {
257 const double r1 = 4;
258 const double r2 = 10;
259 const double v1 = 4 * r1 * r1 * r1 * 3.141593 / 3;
260 const double v2 = 4 * r2 * r2 * r2 * 3.141593 / 3;
261 cout << static_cast<int>(pow(v1 + v2, 1.0 / 3.0));
262 } else if(T == 14) {
263 cout << 50;
264 }
265 return 0;
266 }

被这些函数引用 luogu::TEST().


该类的文档由以下文件生成: