标签:main stdio.h 两个指针 lib oid code scanf 错误 span
#include<stdio.h> #include<stdlib.h> void swap(int *p,int *q)//建立swap函数,定义两个指针,并把两个指针的地址交换 { int x=*p; *p=*q; *q=x; return; } main() { int m,n;//定义两个变量 printf("请输入两个数,m,n\n");//输入两个数 scanf("%d,%d",&m,&n); swap(&m,&n);//交换 printf("%d,%d\n",m,n);//输出 system("pause"); }
总结
没什么感觉,没出现过错误
标签:main stdio.h 两个指针 lib oid code scanf 错误 span
原文地址:http://www.cnblogs.com/sucibai/p/6601036.html