-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbeautiful meadow.cpp
More file actions
78 lines (65 loc) · 884 Bytes
/
beautiful meadow.cpp
File metadata and controls
78 lines (65 loc) · 884 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
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
#include<iostream>
#include<string>
#include<vector>
#define MAX 10
using namespace std;
int alp_to_num(char a)
{
if(a=='0')
return 0;
else
return 1;
}
int main(int argc,char *argv[])
{
vector<string> v;
//string s;
char c[MAX];
int N,M;
cout<<"input N and M:";
cin>>N>>M;
cin.get();
//cout<<N<<" "<<M<<endl;
for(int i=0;i<N;i++)
{
string s;
getline(cin,s);
v.push_back(s);
// s="";
}
int sum;
sum=0;
for(int i=0;i<v.size();i++)
{
for(int j=0;j<M;j++)
{
// cout<<v[i][j]<<" ";
sum=sum+alp_to_num(v[i][j]);
// cout<<sum<<endl;
}
}
cout<<sum<<endl;
if(sum==N*M)
{
cout<<"not beautiful"<<endl;
}
else
{
for(int i=0,j=0;i<v.size();)
{
for(;j<M;)
{
// sum=sum+v[i][j];
if(v[i][j]==0)
{
//考虑的也真是。。。。。。。。。醉了
}
}
}
if((i==(N-1))&&j==(M-1))
{
cout<<"b"<<endl;
}
}
}
}