-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1239.cpp
More file actions
58 lines (54 loc) · 1.27 KB
/
1239.cpp
File metadata and controls
58 lines (54 loc) · 1.27 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
53
54
55
56
57
58
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef vector<string> vs;
typedef vector<int> vi;
typedef set<char> sc;
typedef pair<int, int> pii;
#define mp make_pair
#define pb push_back
#define pi 3.1415926535897932384626433832795
#define MOD 1000000007
#define For(n) for(int i=0; i<n; i++)
#define Revl(n) for(int i=n; i>=0; i--)
#define FOR(p,k) for(int i=p; i<k; i++)
#define Sort(x) sort(x.begin(), x.end())
#define Revs(x) reverse(x.begin(), x.end())
#define mem(a,b) memset(a, b, sizeof(a))
#define two(i) ((ll)1<<i)
int main()
{
// freopen("in.txt", "r", stdin);
string s;
int u, b;
while(getline(cin, s))
{
// cin.ignore();
u=0, b=0;
string n="";
for(int i=0; i<s.size(); i++)
{
if(s[i]=='*')
{
if(b&1)
n+="</b>";
else
n+="<b>";
b++;
}
else if(s[i]=='_')
{
if(u&1)
n+="</i>";
else
n+="<i>";
u++;
}
else
n+=s[i];
}
cout<<n<<endl;
}
return 0;
}