CodeForces 7A - Kalevitch and Chess
来源:互联网 发布:微商城与淘宝的区别 编辑:程序博客网 时间:2024/05/17 01:07
数学题,计算画几次能画出要求的图形。
#include <iostream>#include <cstdio>#include <cmath>#include <cstdlib>#include <iomanip>#include <algorithm>#include <cctype>#include <stack>#include <queue>#include <string>#include <cstring>#include <iomanip>#include <set>#include <vector>#include <cstdio>#include <stack>#include <sstream>#include <cstring>#include <map>using namespace std;char arr[9][9];int main(){for(int i=0;i<8;++i){for(int j=0;j<8;++j){cin>>arr[i][j];}}int res1=0; for(int j=0;j<8;j++){if(arr[0][j]=='B'){int cnt=0;for(int k=1;k<8;k++){if(arr[k][j]=='B')cnt++;if(cnt==7)res1++;}}} int res2=0; for(int i=0;i<8;i++){if(arr[i][0]=='B'){int cnt=0;for(int k=1;k<8;++k){if(arr[i][k]=='B')cnt++;if(cnt==7)res2++;}}}if(res1+res2==16)cout<<"8"<<endl;else cout<<res1+res2<<endl;return 0;}
0 0
- codeforces 7A - Kalevitch and Chess
- Codeforces 7A Kalevitch and Chess
- CodeForces 7A Kalevitch and Chess
- CodeForces 7A Kalevitch and Chess
- CodeForces 7A Kalevitch and Chess
- codeforces 7 A. Kalevitch and Chess
- CodeForces 7A - Kalevitch and Chess
- CodeForces 7A Kalevitch and Chess
- Codeforces 7A Kalevitch and Chess
- 7A Kalevitch and Chess
- Codeforces Beta Round #7 A. Kalevitch and Chess
- CodeForces - 7A Kalevitch and Chess(搜索?!模拟!)
- A. Kalevitch and Chess
- code forces 7A Kalevitch and Chess
- 【取巧遍历】#7 A. Kalevitch and Chess
- CF 7A Kalevitch and Chess
- cf 7a Kalevitch and Chess
- A. Kalevitch and Chess【思维】
- VS2010统计程序代码总行数
- redis实战基础篇:redis的5种数据类型的基本操作
- interactive/non-interactive, login/non-login shells
- 1007. Maximum Subsequence Sum (25)
- 【DirectX 2D游戏开发基础】DirectX的应用实例
- CodeForces 7A - Kalevitch and Chess
- CCComponentContainer,CCComponent解析
- 关于Manifest
- mysql的交集与差集
- 验证二叉查找树
- VS下生成与配置静态库与动态库(一)
- 设计模式---策略模式
- 不跟进,便淘汰
- Dui缓慢飘出窗体的实现