#include <stdio.h>
int main() {
printf("我在编程中国学C语言\n\n");
// 练习一下循环的使用
int i;
for (i=1; i<=20; i++) {
printf("我爱编程中国 %d 次\n", i);
}
printf("\n\n绘制一个心形图案:");
......................
阅读全部
|
曾大仙
贴于 2022年4月28日 15:45
hide
bbsi
#include <stdio.h>
#include <assert.h>
#include <string.h>
//memcpy制作
void* my_memcpy(void* dest, const void* src, size_t num)
{
assert(dest && src);
char* tmp = dest;
while (num--)
{
*(char*)tmp = *(char*)src;
tmp = (char*)tmp+1;
......................
阅读全部
|
nn154189906
贴于 2022年4月25日 16:20
hide
bbsi
#include <stdio.h>
int main()
{
int i,m=0;
for (i = 100; i <= 200; i++)
{
if (i % 3 == 0) continue;
printf("%d,", i);
m=m+1;
if(m%10==0)
printf("\n");
}
......................
阅读全部
|
jinping
贴于 2022年4月21日 16:49
hide
bbsi
#include <stdio.h>
#include <string.h>
#include <assert.h>
//strstr 查看str1中是否有str2,有则返回str1z中
//的相同的第一字符的起始地址,没有则NULL
char* my_strstr(const char* str1, const char* str2)
{
assert(str1 && str2);
const char* s1 = NULL;
const char* s2 = NULL;
const char* cp = str1;
if (*str2=='\0')
......................
阅读全部
|
nn154189906
贴于 2022年4月19日 23:06
hide
bbsi
#include <stdio.h>
#include <string.h>
#include <assert.h>
//对strcmp进行实现和使用
// int my_strcmp(const char* str1, const char* str2)
// {
// assert(str1&&str2);
// while (*str1 == *str2)
// {
// if (*str1 == '\0')
// {
......................
阅读全部
|
nn154189906
贴于 2022年4月19日 22:12
hide
bbsi
#include <stdio.h>
#include <string.h>
#include <assert.h>
//对strcat进行使用和实现
// int main()//追加函数
// {
// char arr[20] = "hello ";
// strcat(arr, "world!");
// printf("%s", arr);
// return 0;
// }
......................
阅读全部
|
nn154189906
贴于 2022年4月19日 21:44
hide
bbsi
CODE SEGMENT
ASSUME CS:CODE
START:
MOV BX, 1000H
MOV SI, 1000H
LEA DI, [BX+SI]
MOV WORD PTR [DI], 1234H
MOV WORD PTR [DI+2], 5678H
L1: LDS BX, [DI]
MOV BX, DI
MOV AL, 3
L2: XLAT
......................
阅读全部
|
rainXsung
贴于 2022年4月19日 10:58
hide
bbsi
#include <stdio.h>
// int main()
// {
// int a[5] = {1,2,3,4,5};
// int* ptr = (int*)(&a+1);
// printf("%d %d", *(a+1), *(ptr-1));
// return 0;
// }
//杨氏矩阵,o(n)的空间复杂度,找数字
// int find_num(int arr[3][3], int r, int c, int k)
......................
阅读全部
|
nn154189906
贴于 2022年4月17日 21:44
hide
bbsi
section .data ;section declaration
msg db "Hello, 编程中国",0xA ;our dear string
len equ $ - msg ;length of our dear string
section .text ;section declaration
;we must export the entry point to the ELF linker or
global _start ;loader. They conventionally recognize _start as their
;entry point. Use ld -e foo to override the default.
_start:
;write our string to stdout
mov eax,4 ;system call number (sys_write)
mov ebx,1 ;first argument: file handle (stdout)
mov ecx,msg ;second argument: pointer to message to write
......................
阅读全部
|
暗夜之狼
贴于 2022年4月17日 13:23
hide
bbsi