-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path0.cpp
More file actions
52 lines (51 loc) · 1.14 KB
/
0.cpp
File metadata and controls
52 lines (51 loc) · 1.14 KB
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
<<<<<<< HEAD
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ll;
int main()
{
ll n, price = 1000, sum = 0;
cin >> n;
ll week = n / 7, day = n % 7;
while (week--)
{
sum += price * 7;
price += 1000;
}
sum += price * day;
string s = to_string(sum);
ll len = s.length();
vector<char> v;
for (int i = len - 1; i >= 0; i--)
{
if ((len - i - 1) % 3 == 0 && (len - i - 1) != 0)
v.push_back('.');
v.push_back(s[i]);
}
reverse(v.begin(), v.end());
v.push_back('v');
v.push_back('n');
v.push_back('d');
for (auto i : v)
cout << i;
=======
// Tìm độ dài của xâu ký tự cuối cùng trong chuỗi bao gồm dấu cách
#include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
getline(cin, s);
int i = s.length() - 1;
while (!((s[i] <= 'Z' && s[i] >= 'A') || (s[i] <= 'z' && s[i] >= 'a') || (s[i] <= '9' && s[i] >= '0')))
{
i--;
}
int j = i;
while (s[j] != ' ' && j >= 0)
{
j--;
}
cout << i - j << endl;
>>>>>>> 025ac0a2cb48fb536e3826fdb08321f5f75f6846
}