gmth.net
当前位置:首页 >> C语言问题求助:利用指针编写一个C程序 >>

C语言问题求助:利用指针编写一个C程序

#include int main(){int ary[10], swap;int *ip, *end(ary + 10);for ( ip = ary; ip < end; ++ip )scanf("%d",ip);for ( ip = ary, end--; ip

1. #include "stdio.h" double getAve(int *a,int n) { int *p; int sum=0; for(p=a;p

#include main() { int a[]={12,6,4,9,3,8}; int *p=a; int i,j; for(i=0;i

#include #include struct Node; typedef struct Node *PtrToNode; typedef PtrToNode Stack; struct Node { int x; PtrToNode Next; }; int IsEmpty( Stack s ) { return s->Next == NULL; } void Push( int x, Stack s )//压栈 { PtrToNode Tm...

我给你一段很相似的参考程序,理解后自己修改才能提高埃 void three(){int i;struct student {char num[5];char name[10];int math;int english;};struct student str[3];struct student * p;p=str;for(i=0;i

#includeint main(){char s[100],*p ,*q ;puts("输入小于100个字符:");gets(s);char del_x;printf("输入要删除的字符:");scanf("%c",&del_x);for(p=s,q=s;*p!='\0';p++) if(*p!=del_x)*q++=*p;*q=*p;puts(s);return 0;}

#includevoid rev(s[]){char *p,*q,c; p=s;//头 q=s;//尾 while(*q) q++; q--; while(p

是不是要这样的程序啊: #include //求字符串长度 int length(char *s){ int i=0; while(s[i]) i++; return i; } int main(){ char str[50]; int n; scanf("%s",str); n=length(str); printf("%d\n",n); }

n和字符 ? n个字符吧? #includechar s[105];int main(){int n = 0,i;while(scanf("%c",&s[n]) == 1) {if(s[n] == '0') break;else n++;}char *p = s;for(i = 0;i

#include int main(){int a[256], *p = a, *maxv=a, *minv=a, n;scanf("%d", &n);for (int i = 0; i < n; ++i){scanf("%d", p + i);if (i == 0)maxv = minv = p;else {if (*maxv*(p + i))minv = p + i;}}printf("%d %d %d %d\n", *maxv, maxv - ...

网站首页 | 网站地图
All rights reserved Powered by www.gmth.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com