标签:san str esc std rip nis desc seve span
/*
============================================================================
Name : p146.c
Author : zhangsan
Version :
Copyright : Your copyright notice
Description : 1+2+3+4+...+10, 教材p146
============================================================================
*/
#include <stdio.h>
#include <stdlib.h>
#include "p146.h"
#define MAX_NUM 10
int iseven(int kk)
{
if(kk%2==0)
return kk;
return 1;
}
int add(int s,int ii)
{
int mm;
mm=iseven(ii);
s=s+mm;
return s;
}
int main(void) {
for(i=0;i<=MAX_NUM;i++)
{
result=add(result,i);
}
printf("1+2+3+...+10=%d",result);
FILE f;
f._ptr="c:\\ff.txt";
printf("%s",f._ptr);
return 1;
}
p146.h //头函数
/*
* p146.h
*
* Created on: 2019-6-29
* Author: Administrator
*/
#ifndef P146_H_
#define P146_H_
int result=0,i;
#endif /* P146_H_ */
标签:san str esc std rip nis desc seve span
原文地址:https://www.cnblogs.com/duanqibo/p/11108570.html