#include<iostream>#include<array>usingnamespace std;voidmain(){int n1, n2;cin >> n1 >> n2;int sum =0;for(int i = n1; i <= n2; i++){sum += i;}cout << sum;}
2
#include<iostream>#include<array>usingnamespace std;constint ArSize =16;voidmain(){array<longdouble,ArSize> factorials;factorials[1]= factorials[0]=1;for(int i =2; i < ArSize; i++)factorials[i]= i * factorials[i -1];for(int i =0; i < ArSize; i++)std::cout << i <<"!="<< factorials[i]<< std::endl;}
3
#include<iostream>#include<array>usingnamespace std;voidmain(){int sum =0;int n =1;while(n !=0){cin >> n;sum += n;cout << sum << endl;}}
#include<iostream>#include<vector>#include<string>usingnamespace std;voidmain(){vector<string> sells ={"January","February","March","April","May","June","July","August","September","October","November","December"};vector<int>number(12);int total =0;for(int i =0; i <12; i++){cout <<"Total sells in "<< sells[i]<<" is:"<< endl;cin >> number[i];total += number[i];}cout <<"total sells is"<< total << endl;}
6
#include<iostream>#include<vector>#include<string>usingnamespace std;voidmain(){vector<vector<string>>sells(3,vector<string>(12));sells={{"January","February","March","April","May","June","July","August","September","October","November","December"},{"January","February","March","April","May","June","July","August","September","October","November","December"},{"January","February","March","April","May","June","July","August","September","October","November","December"}};vector<vector<int>>number(3,vector<int>(12));int total_per_year[3]={0,0,0};int total =0;for(int j =0; j <3; j++){for(int i =0; i <12; i++){cout <<"Total sells in "<< sells[j][i]<<" No."<<j+1<<"year is:"<< endl;cin >> number[j][i];total_per_year[j]+= number[j][i];total += number[j][i];}cout <<"total sells in No."<< j+1<<" year is"<< total_per_year[j]<< endl;}cout <<"total sells of all years is"<< total << endl;}
作者:Wayne Gao, Yi Wang, Jie Chen, Sarika Mehta
Alluxio 作为全球领先的 AI 缓存解决方案供应商, 提供针对 GPU 驱动 AI 负载的高速缓存。其可扩展架构支持数万个节点,能显著降低存储带宽的消耗。Alluxio 在解决 AI 存储挑战方面的前沿技…