个人项目实践

1.#include<iostream>

   using namespace std;

   int main(void)

   {

      int a[100]={-2574,-4010,8243,771,2447,-5197,2556,8044,3314,3617,6065,-2817,3131,6318,2186,-113,629,-2582,-37,-1520,164,2055,-5936,5912,1717,5988,4781,5757,892,-4394,8034,2213,-1080,-2080,5364,106,2657,566,3940,-5116,4583,1806,6555,2621,-7197,528,1626,18,1049,6243,3198,4397,-1325,9087,936,-6291,662,-178,135,-3473,-2385,-165,1713,-7949,-4234,1138,2212,104,6968,-3632,3801,1137,-1296,-1215,4272,6223,-5922,-7723,7044,-2938,-8180,1356,1159,-4022,-3713,1158,-8715,-4081,-2541,-2555,-2284,461,940,6604,-3631,3802,-2037,-4354,-1213,767},                                                    int sum=0;

     for(i=0,i<100;i++)

      {

        cin>>a[i];

        sum +=a[i];

       }

      cout<<sum<<endle;

      return 0;

     }

 

2.#include<iostream>

   using namespace std;

   int main(void)

   {

     int b[2][100]=

{{-2574,-4010,8243,771,2447,-5197,2556,8044,3314,3617,6065,-2817,3131,6318,2186,-113,629,-2582,-37,-1520,164,2055,-5936,5912,1717,5988,4781,5757,892,-4394,8034,2213,-1080,-2080,5364,106,2657,566,3940,-5116,4583,1806,6555,2621,-7197,528,1626,18,1049,6243,3198,4397,-1325,9087,936,-6291,662,-178,135,-3473,-2385,-165,1713,-7949,-4234,1138,2212,104,6968,-3632,3801,1137,-1296,-1215,4272,6223,-5922,-7723,7044,-2938,-8180,1356,1159,-4022,-3713,1158,-8715,-4081,-2541,-2555,-2284,461,940,6604,-3631,3802,-2037,-4354,-1213,767},
{2740,-4182,-5632,-2966,-1953,567,-8570,1046,2211,1572,-2503,-1899,3183,-6187,3330,3492,-464,-2104,316,8136,470,50,466,-1424,5809,2131,6418,-3018,6002,-8379,1433,1144,2124,1624,-602,-5518,5872,870,-5175,-3961,-427,-6284,2850,481,6175,141,-766,-1897,-748,-4248,366,4823,3003,1778,3256,2182,2253,5076,5540,-2650,2451,-1875,5482,-6881,-329,-969,-8032,-2093,612,1524,-5492,5758,-7401,-5039,3241,6338,3581,4321,-1072,4942,2131,210,-7045,-7514,7450,-1142,-2666,-4485,-639,2121,-5298,-3805,-1686,-2520,-1680,2321,-4617,-1961,2076,7309}};
int sum=0;
for(i=0,i<2;i++)
{
for(j=0,j<100;j++)
cin>>a[i][j];
sum +=a[i][j];
}
cout<<sum<<endle;
return 0;
}

个人小结:

   通过这次作业,我发现一维数组和二维数组还是相对简单的,但是由于java学习的比较差,所以我选择了使用c++来完成,但我的电脑里未安装visual c++ 6.0这一软件,所以我无法检验本次试验的正确性,望老师见谅。

   至于老师们提到的CSV,我根本没有听说过,希望下次课堂上鞠老师可以详细地给我们讲解它的具体用法,学的东西多一点,毕竟没有坏处。

   这次实验,我深深地体会到了,自己真正掌握的真的是太少太少了,以后要好好努力!

 

 

   

你可能感兴趣的:(个人项目实践)