首页    新闻    小组    威客    人才    下载    博客    代码贴    在线编程    论坛
代码贴随便看看C语言
​/*
01背包动态规划思维不同于常规思维,
掌握方法及参数的内容,
动态转移方程的理解熟。
通过实例学习,
序号(i)|单个物体重量w(i)|单个物品价值v(i)
1         22            15
2         18            18
3         9             10
4         24            13
5         15            20
包能承最大重35
......................
阅读全部 | qunxingw 贴于 2021年2月18日 11:54     hide bbsi
#include <stdio.h>
#include <malloc.h>
#include <ctype.h>
#include <string.h>

bool file_exists(const char* file)
{
    FILE* f = fopen(file, "r");

    if (!f) {
        return false;
    }
......................
阅读全部 | lvhui123456 贴于 2021年1月27日 15:57     hide bbsi
#include <stdio.h>
#include <malloc.h>
#include <ctype.h>
#include <string.h>

bool file_exists(const char* file)
{
    FILE* f = fopen(file, "r");

    if (!f) {
        return false;
    }
......................
阅读全部 | lvhui123456 贴于 2021年1月27日 15:56     hide bbsi
//  https://v.douyin.com/JTdQ2So/ 矗接觀看视频!
#include<stdio.h>

int A[9];
int a[9]={1,2,3,4,5,6,7,8,9};

int isok(int n)//分析A[]第N个数与前面的数比较为递归 作准备。 
{
    int flag=1,i;
   
    for(i=0;i<n;i++){
      if(A[n]==A[i])  flag=0;//不与前面已选择的数相同 
......................
阅读全部 | qunxingw 贴于 2021年1月26日 17:01     hide bbsi
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <unistd.h>

void waiting(),stop();
int wait_mark;

void main() {
  int p1,p2;
  if (p1=fork()) {                /*创建子进程 p1*/
      if (p2=fork()) {            /*创建子进程 p2*/
......................
阅读全部 | blue1 贴于 2021年1月25日 19:51     hide bbsi
dtgvcxdtfyghv
阅读全部 | 尘零 贴于 2021年1月16日 18:24     show bbsi
/*
一个排序问题求解
全班同学排成 6 排, A 、 B 、 C 、 D 、 E 、 F 等 6 人分别站在第 1 排到第 6 排 • 用 6 个 int 变量表示 A — F 的位置 – 

A 不在第 1 排 a != 1

A 与 B 前后相邻  (a == b + 1) || (a == b - 1) 

C 在 D 前面 c == d - 1 

E 在 B 的前两排  e == b - 2  

......................
阅读全部 | qunxingw 贴于 2021年1月6日 16:19     hide bbsi
//全排列
#include<stdio.h>
char A[6];
char a[6]={'a','b','c','d','e','F'};

int isok(int n)//分析A[]第N个数与前面的数比较为递归 作准备。 
{
    int flag=1,i;
   
    for(i=0;i<n;i++){
      if(A[n]==A[i])  flag=0;//不与前面已选择的数相同 
        } 
......................
阅读全部 | qunxingw 贴于 2021年1月6日 16:17     hide bbsi
include<stdio.h>
int main()
{
int a, b,c,d,f;
printf("输入一个数");
scanf_s("%d", &a);

printf("在输入一个");
scanf_s("%d", &b);
printf("还需要一个:");
scanf_s("%d",&c);

......................
阅读全部 | kande_110 贴于 2021年1月6日 00:41     hide bbsi
include<stdio.h>
int main()
{
int a, b,c,d,f;
printf("输入一个数");
scanf_s("%d", &a);

printf("在输入一个");
scanf_s("%d", &b);
printf("还需要一个:");
scanf_s("%d",&c);

......................
阅读全部 | LIQISH 贴于 2021年1月5日 22:25     hide bbsi
上一页 33 34 35 36 37 38 39 40 41 42 下一页