0
点赞
收藏
分享

微信扫一扫

daily study 3

学习goto语句,可以直接跳到需要的位置。

学习函数,分为库函数和自定函数,学习函数的参数,调用,嵌套调用和链式调用,函数的声明和定义,函数的递归

c语言库函数:io函数,字符串操作函数,字符操作函数,内存操作函数,时间/日期操作函数,数学函数,其他库函数。

了解了两个c语言参考网站​​https://legacy.cplusplus.com/reference/​​

​​https://zh.cppreference.com/w/%E9%A6%96%E9%A1%B5​​

自定函数:函数类型  函数名(函数参数){

语句项

}

//#include<stdio.h>

//int get_max(int x, int y)

//{

// if (x > y)

//  return x;

// else

//  return y;

//}

//int main()

//{

// int a, b;

// printf("enter tow num>");

//  scanf("%d%d", &a, &b);

//  int max=get_max(a, b);

//  printf("the large num is>%d", max);

//

// return 0;

//}

#include<stdio.h>

void Swap(int* x, int* y)

{

int tmp = 0;

tmp = *x;

*x = *y;

*y = tmp;

}

int main()

{

int a, b;

printf("please enter tow num to exchange>");

scanf("%d%d",&a,&b);

printf("a is %d,b is %d\n", a, b);

Swap(&a, &b);

printf("after exchange,a is %d,b is %d", a, b);

return 0;

}

举报

相关推荐

0 条评论