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

洛谷 P1089 [NOIP2004 提高组] 津津的储蓄计划 更多...

#include <luogu.h>

静态 Public 成员函数

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

详细描述

洛谷 P1089 [NOIP2004 提高组] 津津的储蓄计划

在文件 luogu.h365 行定义.

成员函数说明

◆ main()

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

在文件 luogu.cpp1069 行定义.

1069 {
1070 int budget;
1071 int saving = 0;
1072 int current = 0;
1073 for(int i = 0; i < 12; i++) {
1074 current += 300;
1075 cin >> budget;
1076 if(current < budget) {
1077 cout << -(i + 1);
1078 return 0;
1079 }
1080 current -= budget;
1081 saving += current / 100 * 100;
1082 current %= 100;
1083 }
1084 cout << current + saving / 5 * 6;
1085 return 0;
1086 }

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


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