一些调查
  • 板块灌水区
  • 楼主Alea
  • 当前回复29
  • 已保存回复29
  • 发布时间2023/1/27 19:39
  • 上次更新2023/10/24 02:55:19
查看原帖
一些调查
322792
Alea楼主2023/1/27 19:39
  1. 你的数组从0开始用还是从1开始用?你觉得这浪费吗?
  2. 你在编写一些简单函数(例如cmpmaxgcd)会使用三目运算符还是if?会压行吗?
  3. 你用的是cin,scanf还是getint(自写读入函数)?
  4. 下面是一份代码,请用你的码风写一遍。
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
using namespace std;
int gcd(int a,int b){return b==0?a:gcd(b,a%b);}
struct c{
    int d;
    char e;
    c(int d=9,char e=0):d(d),e(e){};
    int f(int g){
        int h=d;
        return max(g,h);
    }
}cS[10];
int main(){
    int i;
    cin>>i;
    for(int j=1;j<=10;j++){
        cout<<j<<endl;
    }
    if(i%3==0) cout<<1;
    else if(i%3==1) cout<<2;
    else if(i%3==2){
        switch(i%1029){
        case 0:
            cout<<"114514"<<endl;
            break;
        default:
            cout<<"1145141919810"<<endl;
        }
    }
    srand(1920);
    int h[2024]={};
    for(int k=1;k<=2020;k++) h[k]=rand();
    sort(h+1,h+2020+1,[](int a,int b)->bool{return a<b;});
    for(int l=1;l<=2020;l++) cout<<h[l]<<endl;
    return 0;
}
2023/1/27 19:39
加载中...