23,125
社区成员
发帖
与我相关
我的任务
分享
#include<stdio.h>
#include"sum.h"
int main( void ){
int a = 0;
int b = 0;
puts("输入两个整数:");
scanf("%d %d",&a,&b);
printf("%d + %d = %d\n",a,b,sum(a,b));
return 0;
}
#ifndef _SUM_H_
#define _SUM_H_
int sum( int a , int b );
#endif//_SUM_H_
#include"sum.h"
int sum( int a , int b ){
return a + b;
}
CC=gcc
CCFLAGS=-c -Wall
OBJS=test.o sum.o
test:${OBJS}
test.o:test.c sum.h
sum.o:sum.c sum.h
.PHONY:clean-all clean-objs clean-app rebuild
clean-all:clean-objs clean-app
clean-objs:
-rm ${OBJS}
clean-app:
-rm test
rebuild: clean-all
make