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

AcWing 714. 连续奇数的和 1 更多...

#include <acwing.h>

静态 Public 成员函数

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

详细描述

AcWing 714. 连续奇数的和 1

在文件 acwing.h692 行定义.

成员函数说明

◆ main()

int acwing::acwing714::main ( istream &  cin,
ostream &  cout 
)
static

在文件 acwing.cpp1920 行定义.

1920 {
1921 short x;
1922 short y;
1923 cin >> x >> y;
1924 if(y < x) {
1925 const auto temp = x;
1926 x = y;
1927 y = temp;
1928 }
1929 int count = 0;
1930 for(int i = x + 1; i < y; i++) {
1931 if(i % 2 != 0) {
1932 count += i;
1933 }
1934 }
1935 cout << count;
1936 return 0;
1937 }

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


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