利用指向函数的指针实现函数调用
以下程序利用指向函数的指针实现函数调用,完成可选择的加减乘除运算。#include 'stdio.h'/*定义函数add*/int add(int x,int y){ printf('%d+%d=',x,y);return x+y;}/*定义函数sub*/int...
利用指针找出3个整数中的最小数
以下程序的功能是利用指针找出3个整数中的最小数。#include 'stdio.h'void main( ){ int *p1,*p2,*p3,min,x,y,z;p1=&x;p2=&y;p3=&z;printf('please input three integer: ');scanf(...
下列程序的执行结果是什么
下列程序的执行结果是什么?#include 'stdio.h'void sort (int *x, int *y, int *z){ int t ;if (*x>*y) {t=*x;*x=*y;*y=t;}if (*x>*z) {t=*x;*x=*z;*z=t;}if (*y>*z) {t=*y;*y=*z;*z=...
下列程序的执行结果是什么
下列程序的执行结果是什么?#include 'stdio.h'void main(){char *s2='I love China! ',**s1=&s2; char *s3,c,*s4='w'; s3=&c; *s3='H'; s2=s2+2; printf('%s\t%c\t%s\t%c\n',s2,*...
下列程序的执行结果是什么
下列程序的执行结果是什么?#include 'stdio.h'void main( ){ int a,b,t;int *pa=&a,*pb=&b;printf('please input two number:');scanf('%d%d',pa,pb);t=*pa;*pa=*pb;*pb=t;printf('a=%...
下列程序的执行结果是什么
下列程序的执行结果是什么?#include 'stdio.h'void main( ){int x,y; int *px,*py; px=&x; py=&y; *px=10; *py=*px+10; printf('x=%d,y=%d\n',x,y); printf('*px=%d,*py=%d\n...
用模块化方法实现数组的四个基本操作
用模块化方法实现数组的四个基本操作:排序、查找、插入和删除。 #include 'stdio.h'#include 'conio.h'#include 'string.h'#define N 4void main(){ char s[N][80],t[80]; int i,...
求出任意一个一维数组元素中最大值和最小值的下标
编写函数求出任意一个一维数组元素中最大值和最小值的下标。在主函数中输入数组元素的值,输出最大值、最小值。 #include 'stdio.h'#include 'conio.h'#define N 4void MaxMin(int x[]...
统计字符串中特定字符的个数
从键盘输入一串字符串,统计字符串中特定字符的个数(特定字符也需要从键盘输入),并输出个数。 #include 'stdio.h'#include 'conio.h'#include 'string.h'void main(){ char s[100],ch...
将其中的所有大写字母改为小写字母
输入一个字符串,将其中的所有大写字母改为小写字母,而所有小写字母全部改为大写字母,然后输出。 #include 'stdio.h'#include 'conio.h'#include 'string.h'void main(){ char s[100];...
在字符串str中找出最大的字符
编写一个程序实现以下功能:在字符串str中找出最大的字符并放在第一个位置上,并将该字符前的原字符往后顺序移动,如 chyab变成ychab。 #include 'stdio.h'#include 'conio.h'#include 'st...
读入的两个字符串s1
以下程序的功能是读入的两个字符串s1,s2进行连接操作(s2连接到s1后)。#include 'string.h'void main(){ char s1[100],s2[100]; int i,j; gets(s1); get...