1、 #include <stdio.h> void put(char x[], int n) { while(n-- > 0) printf(x); putchar('\n'); } int main(void) { char str[128]; int n; printf("str: "); s ...
分类:
编程语言 时间:
2021-06-02 11:11:52
阅读次数:
0
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/types.h> #include <sys/socket.h> #include <sys/un.h> #include <netinet/in.h> ...
分类:
其他好文 时间:
2021-06-02 10:49:05
阅读次数:
0
任务1#include <stdio.h> const int N=3; int main() { int a[N] = {1, 2, 3}; int i; printf("通过数组名和下标直接访问数组元素:\n"); for(i=0; i<N; i++) printf("%d: %d\n", &a ...
分类:
其他好文 时间:
2021-06-02 10:47:49
阅读次数:
0
源码: # include<stdio.h> int main(void){int a,i=0,sum=0;scanf("%d",&a);if(a<0) a=-a;//求负整数的while(a){sum+=(a%10);//sum存各位数之和a/=10;}printf("各位数字之和为:%d\n", ...
分类:
编程语言 时间:
2021-05-25 18:29:36
阅读次数:
0
以下配置为个人开发环境VS2019的NuGet进行的配置 1. NuGet 仅支持 HTTP 代理,Visual Studio 的 NuGet 配置文件位于 %appdata%\NuGet\NuGet.Config 2. 在 <configuration> 节下增加 <config> 节,添加 ht ...
分类:
其他好文 时间:
2021-05-25 18:18:08
阅读次数:
0
define连接字符串 #define conn(x,y) x##y,连接x与y #define toString(x) #x,将x变成字符串 #include <stdio.h> #define conn(x,y) x##y #define toChar(x) #x int main(void) ...
分类:
其他好文 时间:
2021-05-25 18:17:24
阅读次数:
0
C++ 获取GUID #include <objbase.h> #include <stdio.h> //--生成GUID const char* newGUID() { static char buf[64] = {0}; GUID guid; if (S_OK == ::CoCreateGuid ...
分类:
编程语言 时间:
2021-05-25 18:10:12
阅读次数:
0
1、 利用浮点进行循环的时候,计算机不能保证计算机内部转换为二进制后不发生数据丢失,因此随着循环的进行,会发生误差的积累。 #include <stdio.h> int main(void) { int i; float x1 = - 0.01, x2; for(i = 0; i <= 100; i ...
分类:
编程语言 时间:
2021-05-24 17:20:46
阅读次数:
0
更相减损术 #include <stdio.h> int main(void) { int a = 0, b = 0, cnt = 0, min = 0, max = 0, sub = 1; scanf("%d%d", &a, &b); while(!(a & 0x1) && !(b & 0x1)) ...
分类:
编程语言 时间:
2021-05-24 17:03:25
阅读次数:
0
c语言中按位逻辑运算符、位移运算符 #include <stdio.h> int count_bits(unsigned x) { int bits = 0; while(x) { if(x & 1U) bits++; x >>= 1; } return bits; } int int_bits(v ...
分类:
编程语言 时间:
2021-05-24 14:42:05
阅读次数:
0