0硫化铂(PtS)求条
查看原帖
0硫化铂(PtS)求条
1001542
K_func楼主2025/6/14 14:16
#include <bits/stdc++.h>
#include <unistd.h>

namespace Pluto{
	class Velocity_IO{
	protected:
		char BUF[512],OBUF[512];
		char *st=BUF,*en=BUF,*ost=OBUF;
		inline void load_data(){
			int r=en-st;
			if(r<64){
				for(int i=0;i<r;i++){
					BUF[i]=st[i];
				}
				int read_bytes=read(0,BUF+r,256-r);
				if(read_bytes==0) return ;
			}
		}
	public:
		template<typename T>
		inline void readint(T &x){
			x=0;
			T s=1;
			load_data();
			while(*st!='-'&&!isdigit(*st)){
				st++;
				load_data();
			}
			if(*st=='-'){
				s=-1;
				st++;
				load_data();
			}
			while(isdigit(*st)){
				x=x*10+(*st-'0');
				st++;
				load_data();
			}
			x*=s;
		}
		inline void writeInt(long long x) {
			if(x<0){
				*ost++='-';
				x=-x;
			}
			char num[20];
			int len=0;
			do{
				num[len++]=x%10+'0';
				x/=10;
			}while(x);
			while(len--) *ost++=num[len];
			*ost+=' ';
			write(1,OBUF,ost-OBUF);
		}
	};
}

Pluto::Velocity_IO VIO;

using namespace std;

int n,ans=0;

int main(){
	VIO.readint(n);
	for(int i=1;i<=n;i++){
		int a;
		VIO.readint(a);
		ans+=a;
	}
	VIO.writeInt(ans);
	return 0;
}
2025/6/14 14:16
加载中...