Increment.h
int GetIncrement(int iParam);
Increment.c
#include "Increment.h"
int GetIncrement(int iParam)
{
return iParam + 1;
}
Negate.h
int GetNegate(int iParam);
Negate.c
#include "Negate.h"
int GetNegate(int iParam)
{
return iParam * (-1);
}
main.c
#include <stdio.h>
#include <stdlib.h>
#include "Increment.h"
#include "Negate.h"
int main()
{
int iParam0 = GetIncrement(0);
int iParam10 = GetNegate(10);
printf("Input 0 increment function Output = %d\n",iParam0);
printf("Input 10 Negate function Output = %d\n",iParam10);
}
#include <stdio.h>
#include <stdlib.h>
int main()
{
int ch;
int braces = 0;
while ((ch = getchar()) != EOF)
{
/* 左花括号始终是合法的 */
if (ch == '{')
braces += 1;
/* 右花括号只有当它和一个左花括号匹配时才是合法的 */
if (ch == '}')
if (braces == 0)
printf("Extra closing brace!\n");
else
braces -= 1;
}
if (braces > 0)
printf("%d unmatched opening braces!\n", braces);
return EXIT_SUCCESS;
}