第十二周项目一阅读程序(1)①

来源:互联网 发布:windows 10 ast打不开 编辑:程序博客网 时间:2024/04/18 16:39
/**Copyright (c) 2014, 烟台大学计算机学院*All rights reserved.*文件名称:test.cpp*作者:于凯*完成日期:2014年 11 月13日*版本号:v1.0**问题描述:*输入描述:*输出描述:* main.cpp*/#include <iostream>using namespace std;int f(int n);int main(){    cout<<f(5)<<" ";    cout<<f(8)<<endl;    return 0;}int f(int n){    static int a=2;    int b=0;    a+=n;    b+=a;    return b;}


运行结果:

0 0
原创粉丝点击