首页    新闻    小组    威客    人才    下载    博客    代码贴    在线编程    论坛
代码贴随便看看C语言
#include<string.h>
struct student
{int num;
char name[20];
float score[3];
}stu;

main()
{scanf("%d%s%f%f%f",&stu.num,&stu.name,&stu.score[0], /*要记得每个都要加取地址符*/
&stu.score[1],&stu.score[2]);
void print(struct student *);/*不能在此声明函数*/
print(&stu);
......................
阅读全部 | wengzixi 贴于 2025年7月29日 18:28     hide bbsi
#include <iostream>
#include <format>
#include <vector>
#include <string>
#include <thread>
#include <chrono>
#include <random>
#include <ranges>
#include <conio.h>
#include <windows.h>
#include <ctime>
#include <cstdlib>
......................
阅读全部 | wengzixi 贴于 2025年7月29日 13:54     hide bbsi
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

// 函数声明
int add(int a, int b);
int is_prime(int num);
void reverse_string(char *str);

int main() {
    // 测试整数加法
    int sum = add(5, 7);
......................
阅读全部 | oklanbo 贴于 2025年6月5日 14:26     hide bbsi
#include <stdio.h>

int main() {
printf("我在编程中国学C语言\n\n");

// 练习一下循环的使用
int i;
for (i=1; i<=20; i++) {
printf("我爱编程中国 %d 次\n", i);
}

printf("\n\n绘制一个心形图案:");
......................
阅读全部 | 咪咪牛 贴于 2025年5月19日 22:37     hide bbsi
#include <stdio.h>

int main() {
printf("我在编程中国学C语言\n\n");

// 练习一下循环的使用
int i;
for (i=1; i<=20; i++) {
printf("我爱编程中国 %d 次\n", i);
}

printf("\n\n绘制一个心形图案:");
......................
阅读全部 | MIAO0309ZHEN 贴于 2025年5月9日 18:16     hide bbsi
(defun sayHello(name)
    (format t "Hello ~a" name)
)
(sayHello "编程中国")

(write-line "")
(write-line "")

; 练习一下循环的使用
(loop for a from 1 to 20
    do (format t "我爱编程中国 ~d 次" a)
    (write-line "")
......................
阅读全部 | miguo 贴于 2025年4月12日 09:28     hide bbsi
public class HelloWorld {
public static void main(String[] args) {
System.out.println("我在编程中国学JAVA");
System.out.println();

// 练习一下循环的使用
for (int i=1; i<=20; i++) {
System.out.printf("我爱编程中国 %d 次\n", i);
}

System.out.printf("\n\n绘制一个心形图案:");

......................
阅读全部 | RicardoM 贴于 2025年4月3日 22:37     hide bbsi
#include<stdio.h>
#include<stdlib.h>
typedef struct Lnode{
    struct Lnode *next;
    int data;
}Lnode,*ListLink;

Lnode* SearchSame(ListLink L1,ListLink L2){
    if(L1==NULL || L2==NULL){return NULL;}
    int lengthL1=0,lengthL2=0;Lnode *p;
    p=L1;
    while(p->next!=NULL){lengthL1++;p=p->next;}
......................
阅读全部 | sdcz 贴于 2025年3月14日 10:53     hide bbsi
#include<stdio.h>
//以最小为开头,一个一个型
/*int sort(int A[],int low,int high){
    int temp;
    int mean=(low+high)/2;
    if((A[mean]-A[low])*(A[mean]-A[high])<=0){temp=A[low];A[low]=A[mean];A[mean]=temp;}
    else if((A[low]-A[mean])*(A[low]-A[high])<=0){}
    else{temp=A[high];A[high]=A[low];A[low]=temp;}
    temp=A[low];
    while(low<high){
        while(low<high && A[high]>=temp){high--;}
        A[low]=A[high];
......................
阅读全部 | sdcz 贴于 2025年3月13日 19:01     hide bbsi
#include<stdio.h>
#include<stdlib.h>
#define initsize 100
typedef struct{
    int *data;
    int length;
    int maxsize;
}sqlist;
void createlist(sqlist &L){
    L.data=(int *)malloc(sizeof(int)*initsize);
    L.length=0;
    L.maxsize=initsize;
......................
阅读全部 | sdcz 贴于 2025年3月11日 00:03     hide bbsi
1 2 3 4 5 6 7 8 9 10 下一页