-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcharpter7(2).txt
103 lines (98 loc) · 1.72 KB
/
charpter7(2).txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
A
/*
// 编译系统真喵的坑
// 虽然题上没说但是最后也要换行
//emmm...
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <string>
#include <cstring>
using namespace std ;
class tim
{
private:
int y , m , d ;
string s ;
public:
void set()
{
cin >> y >> m >> d >> s ;
}
bool check()
{
for(unsigned int i = 0 ; i < s.length() ; i ++)
if(s[i] == '.') return false ;
return true ;
}
void out()
{
if(check())
cout << y << "-" << m << "-" << d << endl ;
else
cout << y << "年" << m << "月" << d << "日" <<endl ;
}
};
int main()
{
tim t ;
t.set() ;
t.out() ;
return 0 ;
}
*/
B
/*
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <iostream>
using namespace std ;
class node
{
private:
string s;
int salary , y , m , d ;
public:
void get(string _s , int _salary , int _y , int _m , int _d )
{
s = _s ;
salary = _salary ;
y = _y ;
m = _m ;
d = _d ;
}
string outName() {return s ; }
int outSalary() {return salary ; }
int outY() {return y ; }
int outM() {return m ; }
} member[6];
int cal(int n , int y , int m)
{
int t = 0;
int _y = member[n].outY() ;
int _m = member[n].outM() ;
while( _y != y || _m != m)
{
t++ ;
_m ++;
_y += _m / 13 ;
if(_m == 13 ) _m = 1;
}
return t ;
}
int main()
{
member[1].get("wang" , 5000 , 2000 , 10 , 23) ;
member[2].get("liu" , 4500 , 2008 , 1 , 20) ;
member[3].get("huo" , 3800 , 2003 , 7 , 3) ;
member[4].get("ma" , 5300 , 2015 , 4 , 10 ) ;
member[5].get("meng" , 6000 , 2016 , 3 , 16 ) ;
int n ;
cin >> n ;
int _y , _m ; cin >> _y >> _m ;
cout << member[n].outName() << " " << cal(n , _y , _m ) * member[n].outSalary() << endl ;
return 0 ;
}
*/