首页    新闻    小组    威客    人才    下载    博客    代码贴    在线编程    论坛
代码贴随便看看C++
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <time.h> //用到了time函数
using namespace std;
/*
函数功能:实现已排序的两子数组有序合并
函数名:merge
参数:temp:中间数组,临时存放数据
a:待排序数组
left:待排序数组的左边界;right:右边界;middle:中间值
*/
......................
阅读全部 | lookatme 贴于 2018年4月13日 13:00     hide bbsi
#include <graphics.h>  
#include <conio.h>  
#include <math.h>   
int rosesize = 500;  
int h = -250;   
struct DOT  
{  
    double x;  
    double y;  
    double z;  
    double red;     
    double green;       
......................
阅读全部 | 韩道琦 贴于 2018年2月5日 12:30     hide bbsi
#include <graphics.h>  
#include <conio.h>  
#include <math.h>   
int rosesize = 500;  
int h = -250;   
struct DOT  
{  
    double x;  
    double y;  
    double z;  
    double red;     
    double green;       
......................
阅读全部 | 韩道琦 贴于 2018年2月5日 12:30     hide bbsi
#include <stdio.h>
#include <stdlib.h>
main()
{
int x,n=0;
printf("请输入:");
scanf("%d",&x);
for(n=0;x!=1;n++){
if(x%2==1)
{
x=(3*x+1)/2;
}
......................
阅读全部 | xy2436462759 贴于 2018年2月2日 20:15     hide bbsi
#include<iostream>
using namespace std;
int main()
{
        int a,b,c,i;
        cin>>a>>b;
        c=a+b;
        cout<<c;
        srand( time(NULL) );   
for( i = 0; i < 10; i++ )  
   printf( "Random number #%d: %d\n", i, rand() );  
        return 0;
......................
阅读全部 | gxyzly 贴于 2018年1月29日 23:18     hide bbsi
求数据结构按层次遍历普通树的代码或思路
阅读全部 | gxf59 贴于 2017年12月18日 15:32     hide bbsi
#include<iostream>
using namespace std;
int main()
{
int f(int n);
int n;
while(cin>>n)

cout<<f(n)<<endl;
return 0;

 } 
......................
阅读全部 | 小十七 贴于 2017年12月16日 13:33     hide bbsi
出现了error C2143: syntax error : missing ')' before 'constant'
error C2143: syntax error : missing ';' before 'constant'
fatal error C1004: unexpected end of file found错误 有那个大神帮忙处理下呗,以下是代码:
#include <stdio.h>
#include <string.h>
#define n 100

del(char n[100],int b,int k){
int i;
for(i=b;i<=strlen(n)-k;i++)
n[i]=n[i+k];
printf("删除%s位后最小的整数为:\n",n);
......................
阅读全部 | Haru, 贴于 2017年11月16日 21:00     hide bbsi
#include<iostream.h>
#include<stdio.h>
int n,cnt=0;
char num[10];
void dfs(int x){
if(x/16!=0)dfs(x/16);
if((x%16)<10)num[++cnt]=x%16+'0';
else num[++cnt]=x%16-10+'A';
}
int main(){
cin>>n;
dfs(n);
......................
阅读全部 | 妮图 贴于 2017年10月30日 10:49     hide bbsi
有n件物品,质量分别为w[n],背包的容量为s,如果有m件物品的质量的和是s,则这m件物品为一组解,找出所有解
阅读全部 | 蓝天绿水 贴于 2017年10月14日 21:45     hide bbsi
上一页 15 16 17 18 19 20 21 22 23 24 下一页