C
花舞月咏潭
小大不同,日新月异,
展开
-
c数组顺序输出
#include <stdio.h>int main(int argc, char *argv[]){ int i; int v[5]={ 1,2,33,4,5}; for(i = 0;i < 5; i++) { printf("%d\n ",v[i]); } printf("\n");}...原创 2018-12-26 20:40:34 · 1413 阅读 · 0 评论 -
c数组逆序输出
#include <stdio.h>int main(int argc, char *argv[]){ int i; int v[5]={1,3,33,4,58}; for(i = 4; i>=0; i--) { printf("%d\n",v[i]); } printf("\n");}...原创 2018-12-26 21:35:24 · 1316 阅读 · 0 评论 -
C数组插入一个元素
#include <stdio.h>#include<stdlib.h>void insert(int *a,int n,int i,int v){ int j; for (j=n;j>=i;j--) a[j+1]=a[j]; a[i]=v;}int main(int argc, char *argv[]){ int...原创 2018-12-27 21:40:37 · 7537 阅读 · 0 评论 -
C阶乘
#include <stdio.h>int main(int argc, char *argv[]){ int i,m=1; for(i=1;i<=5;i++) m=m*i; printf("%d",m) ; return 0;}原创 2018-12-28 17:27:23 · 1400 阅读 · 0 评论 -
C组合数
#include <stdio.h>#include<math.h>int f(int n) { int i,m=1; for(i=1;i<=n;i++) m*=i; return m; }int main(int argc, char *argv[]){int m,n;scanf("%d%d",&...原创 2018-12-28 17:40:00 · 605 阅读 · 0 评论 -
C三元交换(1)
#include <stdio.h>int main(int argc, char *argv[]){ int t;int a=3;int b=4; t=a; a=b; b=t; printf("%d %d",a,b); return 0;}原创 2018-12-28 22:24:09 · 149 阅读 · 0 评论 -
C三元交换(2)
#include <stdio.h>void swap(int a,int b){ int t=a; a=b; b=t;}int main(int argc, char *argv[]){ int a=3; int b=4; swap(a,b); printf("%d %d\n"...原创 2018-12-28 22:23:50 · 137 阅读 · 0 评论 -
C-----循环链表(1)
#include<stdio.h>#include<stdlib.h>#include<math.h> using namespace std; typedef struct node{ int data; struct node *next;}NODE; int main(void){ NODE a,b,c;...原创 2019-01-13 20:28:10 · 133 阅读 · 0 评论 -
C-----------循环链表(2)
#include<stdio.h>#include<stdlib.h>#include<math.h> using namespace std; typedef struct node{ int data; struct node *next;}NODE; int main(void){ NODE a,b,c;...原创 2019-01-13 20:29:42 · 124 阅读 · 0 评论