-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdms.cpp
More file actions
47 lines (46 loc) · 732 Bytes
/
dms.cpp
File metadata and controls
47 lines (46 loc) · 732 Bytes
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
#include<iostream>
using namespace std;
string cop(char e[])
{
string s;
int i = 0;
while(e[i] != '\0') {
s[i] = e[i];
i++;
}
return s;
}
int check(int a,int u[10],int n)
{
vector<int> pt;
vector<int> :: iterator it;
while(a >= 10) {
pt.push_back(a%10);
a /= 10;
}
pt.push_back(a);
for(it = pt.end()-1;it >= pt.begin();it--) {
u[n] = (*it);
n++;
}
return n;
}
int main()
{
while(!cin.eof()) {
int s,n;
string r;
int u[15];
cin >> s >> r;
n = check(s,u,0);
int a[15] = {0};
char ch[n+1][252];
int i = 0;
int temp = r.length();
int k = 0;
int flag = 1;
if(n%2 == 0) {
int row = temp/n;
if(row%2 == 0) {
fill(a,u,1);
}