btcq.net
当前位置:首页 >> 大一C语言编程题库 >>

大一C语言编程题库

#include <stdio.h>void main(){ int N,A,B; printf("请输入一个数:"); scanf("%d",&N); A=N%10; B=N/10%10; if((A*10+B)*(B*10+A)==N) printf("%d,%d",A,B); else printf("No Answer\n");}这样写就行了.

第一题:#include "stdio.h" void main() { int a,b,sum=0; for(a=0;a main() { char a; int b,c,d,e; b=0;c=0;d=0;e=0; /* b是字母 c是数字 d是符号 e是空格*/ fflush(stdin); printf(

/* 1. */ #include #include char* ReadFile(const char* psz) { FILE* fp = fopen(psz, "r"); if( NULL == fp ) return NULL; fseek(fp, 0, SEEK_END); int nLen = ftell(fp); char* pszBuff = (char*)malloc(nLen + 1); fseek(fp, 0, SEEK_SET); int nSize = fread(

1.#include<stdio.h>int main(){ int i,n,sum =1; printf("please enter a number:"); scanf("%d",&n); for(i=1;i<=n;i++) {版sum *= i; } printf("the result is %d\n",sum); return

#include<stdio.h>#include<conio.h>void main(void){ int i, flag = 1, sum = 0; for(i = 1; i <= 101; i += 2) if(flag) { sum += i; flag = 0; } else { sum -= i; flag = 1; } printf("%d", sum); getch();}#include<stdio.h>#include<conio.h>void main(void) { int num, i;

#include<stdio.h>typedef struct student{ int Grade; int Count; }HIS; void print(int n){ while(n--){ printf("★ "); } } void main(){ HIS gra[40]; int n=0; while(n<40){ printf("请输入第%d个学生的打分(1~10分):",n+1); gra[n].Grade=n+1; scanf(

#include "stdio.h"int n=0;int isprime(int n){ for(int i=2;i<=n/2;i++) if(n%i==0) return 0; return 1;}void sort(int a[]){ int i,j; for(i=0;i<n-1;i++) for(j=0;j<n-1-i;j++) if(a[j]>a[j+1]) { int temp=a[j]; a[j]=a[j+1]; a[j+1]=temp; }}int swap(int n){ int a,b,c; a=n/100; b=n/

a. 杨辉三角:代码如下:-------------------------------------------------------#include <stdio.h>int main(int argc, char *argv[]){ int a[10][10] = ; int i, j; for (i = 1; i < 10; i++) { a[i][0] = 1; a[i][i] = 1; for (j = 1; j < i; j++) { a[i][j] = a[i - 1][j - 1] + a[i - 1][j]; } } for (i = 0; i < 10;

第一题:main(){ long a,n,m,w,sum; w=1; sum=0; printf("请输入a的值:"); scanf("%ld",&a); printf("请输入n的值:"); scanf("%ld",&n); for(m=n;m>0;m--) {

int a;double b,c,d;b=pow(a/100,3); //百位c=pow(a/10%10,3); //十位d=pow(a%10,3);//个位

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