快读的读入问题,
查看原帖
快读的读入问题,
370648
柠檬布丁吖楼主2023/2/2 19:45

为什么本题不可以这样写?


#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<queue>

#define int long long

using namespace std;

inline int read() {
	int ret=0,f=1;
	char c=getchar();
	for(; c<'0'||c>'9'; c=getchar()) if(c=='-') f=-f;
	for(; c>='0'&&c<='9'; c=getchar()) ret=ret*10+c-'0';
	return ret*f;
}

signed main(void) {
	
	int n;
	while(n=read()){
		cout<<(n*n*n*n-6*n*n*n+23*n*n-18*n+24)/24<<endl;
	}

	return 0;
}
2023/2/2 19:45
加载中...