立即注册 登录
萝卜钛客 返回首页

Allen的个人空间 https://robotaics.com/?5 [收藏] [复制] [RSS]

日志

20241116C++

|已有 497 次阅读|2024-11-16 17:32

#include<iostream>
using namespace std;
int main() {
int n, a1, a2, temp;
bool r;
cin >> n >> a1 >> a2;
int d;
d = a2 - a1;
temp = a2;
for (int i = 2; i < n; i++) {
int ai;
cin >> ai;
if (ai == temp + d) {
r = 1;
temp = ai;
} else {
r = 0;
break;
}

}
if (r) {
cout << "True";
} else {
cout << "False";
}
return 0;
}




#include<iostream>
using namespace std;
int main() {
float q,a1=3.00;
int n;
cin>>q;
for(int i=1;a1<=100;i++){
a1*=q;
n=i;
}
cout<<n;
return 1;
}

全部作者的其他最新日志

评论 (0 个评论)

facelist doodle 涂鸦板

您需要登录后才可以评论 登录 | 立即注册

返回顶部