标签:blog os io for ar 2014 cti div
/******************************************************************** @file Main_practise.cpp @date 2014-8-18 @author Tiger @brief 算法学习 @details 加总数字 ********************************************************************/ #include <iostream> const int SIZE = 5; int summation(int arr[], int n); int main(int argc, const char* argv[]) { int arr[] = {3, 6, 9, -8, 1}; std::cout << "总和是" << summation(arr, SIZE) << "." << std::endl; system("pause"); return 0; } int summation(int arr[], int n) { int nSum = 0; for (int i=0; i<n; ++i) { nSum += arr[i]; } return nSum; }
标签:blog os io for ar 2014 cti div
原文地址:http://www.cnblogs.com/roronoa-zoro-zrh/p/3919215.html