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

洛谷 P1307 [NOIP2011 普及组] 数字反转 更多...

#include <luogu.h>

静态 Public 成员函数

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

详细描述

洛谷 P1307 [NOIP2011 普及组] 数字反转

在文件 luogu.h309 行定义.

成员函数说明

◆ main()

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

在文件 luogu.cpp935 行定义.

935 {
936 bool negative = false;
937 int n;
938 int ans = 0;
939 cin >> n;
940 if(n < 0) {
941 n = -n;
942 negative = true;
943 }
944 while(n != 0) {
945 ans *= 10;
946 ans += n % 10;
947 n /= 10;
948 }
949 if(negative) {
950 ans = -ans;
951 }
952 cout << ans;
953 return 0;
954 }

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


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