- 博客(19)
- 资源 (13)
- 收藏
- 关注
原创 B1014
#include <stdio.h>#include <string.h>int main(){ char week[7][5]={"MON", "TUE", "WED","THU", "FRI", "SAT", "SUN"}; char str1[70], str2[70], str3[70], str4[70]; gets(str1); gets(str2);
2017-07-31 19:01:10 484
原创 B1009
#include <stdio.h>#include <string.h>int main(){ char str[90]; gets(str); int len =strlen(str), r = 0, h = 0; char ans[90][90]; for (int i=0; i<len; i++){ if (str[i] != ' '){
2017-07-30 15:48:17 256
原创 B1002
#include <stdio.h>#include <string.h>int main(){ char str[110]; gets(str); int len = strlen(str); int sum = 0; for (int i = 0; i<len; i++){ sum += str[i]-'0'; } int n
2017-07-30 11:06:58 533
原创 B1031
#include <stdio.h>#include <string.h>// B1031// 权重 w[0] = 7, w[1] = 9int w[20] = {7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2};// 校验码, chaneg[0] = '1', change[1] = '0',...char change[15] = {'1','0','X','
2017-07-30 10:35:31 386
原创 B1021
#include <stdio.h>#include <string.h>int main(){ char str[1010]; gets(str); int len = strlen(str); int count[10]= {0}; //记录 0 - 9 的出现的次数,初值均为0 for (int i=0; i<len; i++){ cou
2017-07-30 09:25:16 241
原创 B1006
#include <stdio.h>int main(){ int n; scanf("%d", &n); int num = 0, ans[5]; while( n!= 0){ // 将 n 的每一位存放到ans 数组中 ans[num++] = n%10; n /= 10; } for (int i = num-1;
2017-07-29 23:35:10 225
原创 A1058
#include <stdio.h>int main(){ int a[3], b[3], c[3]; scanf("%d.%d.%d %d.%d.%d",&a[0], &a[1], &a[2], &b[0], &b[1], &b[2]); int carry = 0; // 进位 c[2] = (a[2] + b[2])%29; //获得 carry
2017-07-29 23:23:06 359
原创 A1027
#include <stdio.h>char radix[13] = { //建立 0 ~ 13 与'0' ~ '9', 'A'~'C'的联系 '0', '1', '2', '3','4', '5', '6', '7', '8', '9', 'A', 'B', 'C'};int main(){ int r,g,b; scanf("%d%d%d", &r, &g, &b
2017-07-29 23:11:16 264
原创 A1019
#include <stdio.h>bool Judge(int z[], int num){ // 判断数组z所存的数是否为回文数字,num为位数 for (int i=0; i<=num/2; i++){ if(z[i] != z[num-1-i]){ return false; } } return true
2017-07-29 19:27:26 248
原创 B1037
#include <stdio.h>const int Galleon = 17*29; // 一个加伦可以兑换的纳特数const int Sickle = 29; // 一个西可可以兑换的纳特数 int main(){ int a1,b1,c1; int a2,b2,c2; scanf("%d.%d.%d%d.%d.%d", &a1,&b1,&
2017-07-29 19:07:37 344
原创 B1022
#include <stdio.h>// B1022int main(){ int a,b,d; scanf("%d%d%d", &a, &b, &d); int sum = a + b; int ans[31], num = 0; do{ //进制转换 ans[num++] = sum%d; sum /= d; }
2017-07-29 18:42:17 271
原创 B1036
#include <stdio.h>int main(){ int row,col; char c; scanf("%d %c", &col, &c); if (col%2 == 1) row = (col+1)/2; else row = col/2; // 第一行 for (int i=0; i<col; i
2017-07-23 19:52:46 390
原创 A1036
#include <stdio.h>struct person{ char name[15]; // 姓名 char id[15]; // ID int score; // 分数 }M,F,temp;void init(){ M.score = 101; // 男生的最低分,女生的最高高分 F.score = -1; }i
2017-07-23 19:29:11 263
原创 A1006
#include <stdio.h>struct pNode{ char id[20]; int hh,mm,ss;}ans1,ans2, temp;bool great(pNode node1, pNode node2){ //时间node1 大于node2 返回真 if (node1.hh != node2.hh) return node1.hh>node2
2017-07-23 18:52:11 276
原创 A1011
#include <stdio.h>char S[3] = {'W', 'T', 'L'};int main(){ double ans = 1.0, tmp = 0,a; int idx; //记录每行最大的数字的下标 for (int i=0; i<3; i++){ tmp = 0.0; for (int j=0; j <3; j
2017-07-22 20:49:48 235
原创 B1032
Coder#include <stdio.h>// B1032const int maxn = 100000;int school[maxn] = {0};int main(){ int n,schoolID,score; scanf("%d", &n); for(int i = 0; i<n; i++){ scanf("%d%d", &schoolI
2017-07-22 19:09:13 393
转载 【C语言】在VC中使用gotoxy函数实现光标的移动
#include <stdio.h>#include <conio.h>#include <windows.h>void gotoxy(int x, int y){ COORD coord = {x, y}; /*COORD是Windows API中定义的一种结构,表示一个字符在控制台屏幕上的坐标。其定义为: typedef struct _COORD { S
2017-07-06 20:46:39 1184
原创 C++ 多线程 火车站售票
#include <windows.h>#include <iostream.h>DWORD WINAPI Fun1Proc( LPVOID lpParameter //thread data);DWORD WINAPI Fun2Proc( LPVOID lpParameter //thread data);int index = 0;
2017-07-05 19:01:19 1088
转载 sscanf 函数与 sprintf 函数对比用例
sprintf函数 sprintf函数原型为 int sprintf(char *str, const char *format, …)。作用是格式化字符串,具体功能如下所示:(1)将数字变量转换为字符串。 (2)得到整型变量的16进制和8进制字符串。 (3)连接多个字符串。 char str[256] = { 0 }; int data = 1024; //将data转
2017-07-02 12:13:49 345
网络编程之发送结构体.zip
2020-03-07
9.12 key,亲测可用
2018-03-17
VA and vsVIM 打包下载
2016-07-10
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人