2016年11月10日 星期四

TIOJ 1173 - Sequence

http://tioj.infor.org/problems/1173

普普通通的水題



 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
#include<iostream>
using namespace std;
int a,b,c;
bool _,__;
int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(0);
    cin>>a>>b>>c;
    if(a+c==b+b)_=1;
    if(a*c==b*b && a && b && c)__=1;
    if(_&&__)cout<<"both\n";
    else if(_)cout<<"arithmetic\n";
    else if(__)cout<<"geometric\n";
    else cout<<"normal\n";
}

沒有留言:

張貼留言