C++競プロ学習日記(仮)

( 学習記録であり解説Blogではないです )

2016-09-12から1日間の記事一覧

Round#91 A. Lucky Division|Codeforces

Problem - 122A - Codeforcesを解きました。 #include <bits/stdc++.h> #define REP(i,n) for(int i=0; i<(n); i++) using namespace std; struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star; bool check( int N ){ string S = to_string( N ); REP( i, (int</bits/stdc++.h>…

Switching Railroad Cars|AOJ|stack

stackに慣れる為に車両入れ替え | Aizu Online Judgeを解きました。 #include <bits/stdc++.h> using namespace std; struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star; int main() { int N; stack<int> st; while( cin >> N ) { if( N == 0 ){ // 0が来たら取り</int></bits/stdc++.h>…

C++ で 桁和

#include <bits/stdc++.h> using namespace std; int digit( int N ) { while( N >= 10 ) { int tmp{}; while( N > 0 ) { tmp += ( N % 10 ); N /= 10; } N = tmp; } return N; } int main() { int N{}; cin >> N; cout << digit( N ) << endl; return 0; } とある問題で桁</bits/stdc++.h>…