C 语言实例 - 计算数组元素之和
C 语言教程
· 2019-02-21 05:57:23
使用 for 循环迭代出输出元素,并将各个元素相加:
实例
#include <stdio.h>
int main() {
int array[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0};
int sum, loop;
sum = 0;
for(loop = 9; loop >= 0; loop--) {
sum = sum + array[loop];
}
printf("元素和为:%d", sum);
return 0;
}
输出结果为:
元素和为:45
点击查看所有 C 语言教程 文章: https://codercto.com/courses/l/17.html
Beginning Google Maps API 3
Gabriel Svennerberg / Apress / 2010-07-27 / $39.99
This book is about the next generation of the Google Maps API. It will provide the reader with the skills and knowledge necessary to incorporate Google Maps v3 on web pages in both desktop and mobile ......一起来看看 《Beginning Google Maps API 3》 这本书的介绍吧!