作业:
#include <iostream>
using namespace std;
int chonghe(int,int,int,int);
int main(){int a[1000],b[1000];int n,ma=0;cin>>n;for(int i=0;i<n;i++){cin>>a[i]>>b[i];}for(int i=0;i<n;i++){for(int j=i+1;j<n;j++){ma=max(ma,chonghe(a[i],b[i],a[j],b[j]));}}cout<<ma;return 0;
}
int chonghe(int a1,int b1,int a2,int b2){int ma=max(a1,max(a2,max(b1,b2))),sum=0;for(int i=min(a1,min(a2,min(b1,b2)));i<=ma;i++){if(i>=a1&&i<=b1&&i>=a2&&i<=b2)sum++;}return sum;}
#include <iostream>
using namespace std;
void fc(string, int, int, int);
int n;
int main() {cin >> n;fc("", 1, 0, 0);return 0;
}
void fc(string s, int cnt, int l, int r) {if (l > n || r > n || r > l)return;if (cnt > 2 * n) {cout << s << endl;}fc(s + '(', cnt + 1, l + 1, r);fc(s + ')', cnt + 1, l, r + 1);
}
#include <iostream>
using namespace std;
int main() {int a, b, c;cin >> a >> b >> c;int x = 2;while (a % x != b % x || b % x != c % x) {x++;}cout << x;return 0;
}
#include <iostream>
using namespace std;
int a[10000000];
int main() {a[0] = 1;a[1] = 1;for (int i = 2; i < 10000000; i++) {a[i] = (a[i - 1] + a[i - 2]) % 1000;}int n, c[10000];cin >> n;for (int i = 0; i < n; i++) {cin >> c[i];}for (int i = 0; i < n; i++) {cout << a[c[i] - 1] << endl;}return 0;
}
未做。