自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(37)
  • 资源 (5)
  • 收藏
  • 关注

原创 任意输入20个正整数,找出其中的素数,并将这些素数按由小到大排序。要求:判断一个数是否为素数用函数实现:排序用函数实现

#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#include#define N 20int count = 0 ,k=0,b[N];void bubblesort(int *p2)//从小到大排序{ for (int i = 0; i < k; i++) for (int j = k - 1

2014-05-21 23:21:00 7440

原创 写一主函数输入一数组,写一子函数实现对该数组的冒泡排序并输出。

#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#include#define N 6void bubblesort(int *p)//从小到大排序{ for (int i = 0; i < N; i++) for (int j = N - 1; j >= i; j--) { if (*(p

2014-05-18 23:08:12 5190

原创 在主函数内任意输入一个5X6矩阵,编写一函数求出每一行的和放到一个一维数组中,输出此矩阵及其每一行的和。

#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#include#define M 5#define N 6void linesummation(int *p){ int sum = 0,b[M]; for (int i = 0; i <= M*N; i++) { if (i != 0 &&

2014-05-18 22:15:26 4084

原创 写一函数判断某数是否“水仙花数”,所谓“水仙花数”是指一个三位数,其各位数字立方和等于该数本身。

#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#includevoid judgeArmstrongnumber(int a1){ int b1[3] = { 0 }; int c1 = a1; for (int i = 0; i < 3; i++) { b1[i] = c1 % 10;

2014-05-18 21:31:06 12461

原创 写一函数将字符数组s1中的全部字符复制到字符数组s2中,不用strcpy函数

#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#includeint mystrcpy(char *p,char *p1){ while (*p1 != '\0') { *(p++) = *(p1++); } *p = '\0';}void main(){ char a1[100]

2014-05-18 17:35:11 4086

原创 写一函数,求一字符长度,即编写一strlen函数

#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#includeint mystrlen(char *p){ int i = 0; while (*p != '\0') { p++; i++; } return i;}void main(){ char a[100] = "ab

2014-05-18 17:23:26 1390

原创 写一个函数,将两个字符串连接,即编写一strcat函数

#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#includevoid mystrcat(char *p,char *p1){ while (*p != '\0') p++; while (*p1 != '\0') { *(p++) = *(p1++); }}void main()

2014-05-18 17:11:40 3870

原创 写一个函数,使给定的一个二维数组(NXM)(N=M)转置,即行列互换(要求不额外创建二维数组)

#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#include#define N 3#define M 3void rankexchange(int a1[N][M]){ for (int i = 0; i < N;i++) for (int j = 0; j < i; j++) {

2014-05-18 16:38:58 4013

原创 写一个函数,使给定的一个二维数组(NXM)转置,即行列互换

#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#include#define N 3#define M 3void rankexchange(int a1[N][M]){int b1[N][M];for (int i = 0; i for (int j = 0;

2014-05-18 16:28:49 2456

原创 打印出2到1100之间的全部素数(判断素数由函数实现)

#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#include#includevoid judgesushu(int n1){ int count = 1; for (int i = 2; i < n1; i++) { if (n1%i == 0) { count = 0;

2014-05-18 15:48:53 4220

原创 用指针编写一函数求三个整数的最大值

#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#include#includeint judgemax(int *p){ int max1 = *p; for (int i = 1; i < 3; i++) { if (max1 < *(p + i)) max1 = *(p + i);

2014-05-18 15:07:48 3407

原创 编写一函数判断某数是否是素数

#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#include#include#define N 10void judgesushu(int n1){ int count = 1; for (int i = 2; i < n1; i++) { if (n1%i == 0) { co

2014-05-18 14:45:11 2018

原创 用递归法求N阶勒让德多项式的值

#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#include#includevoid main(){ float pn(float,int); float x, lyd; int n; scanf("%f%d", &x, &n); lyd = pn(x,n); printf("pn=%f

2014-05-18 14:15:48 2093

原创 编写一函数,由实参数来一个字符串,统计此字符串中字母、数字、空格和其它字符的个数,在主函数中输入字符串以及输出上述的结果

#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#include#includevoid fltj(char str[], int a[]){ int ll, i; ll = strlen(str); for (i = 0; i < ll; i++) { if ((64 < str[i] &

2014-05-18 13:29:49 4527

原创 随机打印NXN的拉丁方阵

#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#include#include#define N 5void rowladingmatrix(int a1[N][N] ){ int b1[N] = { 0 }, c1[N][N] = { 0 }; int j,n=0; for (int i =

2014-05-17 20:26:59 832

原创 统计一个单位职工的年龄,要求把相同年龄最多的那个年龄找出来(可能有几个这样的年龄),并统计出现的次数

#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#include#include#define N 100void statisticage(int people2[N],int count1[N]){ for (int i = 0; i < N; i++) { if (people2[i]

2014-05-16 23:54:38 2667

原创 打印出奇数阶魔方阵

#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#include#include#define N 3void main(){ int a[N][N] = { 0 }; for (int i = 1; i <= N*N; i++) { int m[1000], n[1000]; i

2014-05-15 22:40:28 1103

原创 找出MXN数组中所有不相邻元素,并求出它们的和(相邻的数:前一个数是偶数,后一个数是素数)

#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#include#include#define N 5#define M 4int oushu(int a){ if (a % 2 == 0) return 1; else return 0;}int shusu(int b){ for

2014-05-15 00:19:39 1616

原创 求N个数中的最大值,最大值出现的次数,然后求出次大值(次大值一定存在)

#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#include#include#define N 11void main(){ int a[N] = { 1, 2, 3, 4, 5, 6, 12, 7, 8, 10, 12 }; int max = a[0],maxcount=0,maxci=0

2014-05-14 22:28:16 4620

原创 打印所有不超过n(n<256)的其平方具有对称性的数(也称回文数)

#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#include#includevoid main(){ for (int i = 0; i < 256; i++) { int n = pow(i, 2),m; char str[10]; sprintf(str, "%d", n);

2014-05-14 22:08:08 2200

原创 编程产生如下形式的方阵(要求不允许使用键盘输入语句和静态赋值语句,尽量少用循环)

#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#include#includevoid main(){ int a[7][7]; for (int i = 0; i < 7; i++) { for (int j = 0; j < 7; j++) { if (i == j || j

2014-05-14 20:42:21 1657

原创 有17个人围成一圈(编号为0~16),从第0号的人开始从1报数,凡报到3的倍数的人离开圈子,然后再数下去,直到最后只剩下一个人为止。问此人原来的位置是多少号?

#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#include#includevoid taotai(int a[17],int count,int count1){ while (count1 != 1) { for (int i = 0; i < 17; i++) { count+

2014-05-14 20:11:30 9476

原创 有N个国家名,要求按字母先后顺序排列(用起泡排序法后输出)。

#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#include#include#define N 5void jiaohuanguojiaming(int j,char p[N][11]){ char t; for (int k = 0; k < 11; k++)//国家名交换 { if

2014-05-14 16:59:33 7395 1

原创 有一行字符,统计其中的单词个数(单词之间以空格分隔),并将每一个单词的第一个字母改为大写

#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#include#includevoid main(){ char a[] = "hello! the weather of Today is Good, and You are so beautiful!"; int count = 0; if

2014-05-14 15:26:33 6486

原创 将字符数组A中下标为双号(0,2,4,5,8...)的元素值传给另一个字符数组B,然后将B数组的元素按逆序输出

#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#include#includevoid main(){ char A[10] = "abcdefgihd"; int B[10],j=0; for (int i = 0; i < 10; i++)//下标双号字符传递 { if (i%2==

2014-05-14 15:04:24 5507 3

原创 编程序将一个字符串的前N个子字符送到一个字符型数组中去,然后再加上一个'\0'(不允许使用strcoy(str1,str2,n)函数)。

#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#include#include#define N 5void main(){ char a[10] = "abcdefgihd"; int b[9]; for (int i = 0; i < N; i++)//字符传递 { b[i] = a

2014-05-14 14:53:56 3735

原创 把一个二维实型数组a按照第0列的元素进行排序(由小到大排序,用气泡法)

#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#include#includevoid main(){int a[7][4] = { { 1, 2, 3, 4 }, { 8, 7, 6, 5 }, { 12, 10, 11, 9 }, { 1, 3, 4, 5 }, { 23

2014-05-14 14:22:32 2364

原创 有一个二维数组整形数组中,每一行都有一个最大值,编程求出这些最大值以及他们的和

#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#include#includevoid main(){ int a[3][4] = { { 1, 2, 3, 4 }, { 8, 7, 6, 5 }, { 12, 10, 11, 9 } }; int max, m[3], n[3], k = 0,

2014-05-14 13:23:15 10226

原创 打印N行杨辉三角形(1维数组)

#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#include#includevoid main(){ int a[100] = { 0 }; a[0] = 1; for (int k = 0; k < 100; k++)//杨辉三角形复值 { if (k % 10 == 0) {

2014-05-14 12:51:49 1374

原创 打印N行杨辉三角形(2维数组)

#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#include#includevoid main(){ int a[10][10] = { 0 }; for (int k = 0; k < 10; k++)//赋值第一列 { a[k][0] = 1; } for (int i = 1;

2014-05-14 12:22:49 1075

原创 打印杨辉三角形

#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#include#includevoid main(){ int a[6][6] = { 0 }; for (int k = 0; k < 6; k++)//赋值第一列 { a[k][0] = 1; } for (int i = 1; i

2014-05-14 12:13:28 660

原创 求一个3X3矩阵两条对角线上元素之和

#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#include#includevoid main(){ int a[3][3] = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 } }; int total=0; for (int i = 0; i < 3; i+

2014-05-14 11:25:35 4493 2

原创 用筛选法求2到100之间的素数

#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#include#includeint zhaosushu(int a[100 - 1],int n){ int shusu; for (int i = n + 1; i < 100 - 1; i++) { if (a[i] != 0) {

2014-05-14 11:10:03 2617

原创 用选择法对10个整数由大到小排序

#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#include#includevoid main(){ int a[10] = { 1, 543, 65, 2334, 543, 654, 675, 24, 654, 2 }; int max; for (int i = 0; i < 10 -

2014-05-14 10:24:10 1904

原创 用选择法对10个整数由大到小排序

#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#include#includevoid main(){int  a[10] = { 1, 543, 65, 2334, 543, 654, 675, 24, 654, 2 };int max;for (int i

2014-05-14 10:10:57 2606

原创 简单游戏外挂,植物大战僵尸外挂,附cpp源代码

#include "stdafx.h"#include #includeint ***p = (int ***)0x007794F8;unsigned char *Pause = (unsigned char *)0x00472B50;  //指向暂停函数代码头部,内存属性不可写HANDLE hProcess;void ModifyCode(){

2014-05-13 22:31:02 3589 2

原创 输入N个数到数组中,输出所有大于N个数平均值的数(c编程题)

#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#include#include#define N 10void main(){double a[N],total=0.0;for (int i = 0; i {scanf("%lf", &a[i]);tota

2014-05-13 22:25:21 17561

hfs.exe 文件传输服务器

2016-07-28

VC6LineNumberAddin.dll

2016-07-28

VA_X_Setup小番茄

2016-07-28

FileTool vc插件

2016-07-28

用Socket编程实现电子邮件的发送

用Socket编程实现电子邮件的发送

2013-07-03

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除