首页    新闻    小组    威客    人才    下载    博客    代码贴    在线编程    论坛
代码贴随便看看全站
#include <stdio.h>

// int main() //猜杀手
// {
//     char k = 0;
//     for (k='A'; k<='D'; k++)
//     {
//         if((k != 'A')+(k =='C')+(k=='D')+(k!='D')==3)
//         {
//             printf("%c", k);
//         }
//     }
......................
阅读全部 | nn154189906 贴于 2022年4月15日 21:54     hide bbsi
#include <stdio.h>

// int main()
// {
//     unsigned char a = 200;
//     unsigned char b = 100;
//     unsigned char c = 0;
    
//     c = a+b;
//     printf("%d %d", a+b, c);
//  return 0;
// }
......................
阅读全部 | nn154189906 贴于 2022年4月15日 21:02     hide bbsi
#include <stdio.h>

int main() 
{
    int money = 0;
    scanf("%d", &money);
    int total = money;
    int empty = money;
    
    while (empty >=2)
    {
        total += empty/2;
......................
阅读全部 | nn154189906 贴于 2022年4月15日 17:42     hide bbsi
/*
2022年4月15日16点55分
题目:求1+2!+3!+...+20!的和。
*/

#include <iostream>
using namespace std;

long long f(int n)
{
    long long a = 1;
    for (int i = 1; i <= n; i++)
......................
阅读全部 | StarLiver 贴于 2022年4月15日 16:55     hide bbsi
/*
2022年4月15日16点51分
题目:有一分数序列:2/1、3/2、5/3、8/5、13/8、21/13、...求出这个数列的前20项之和。
*/

#include <iostream>
using namespace std;

float f(int n)
{
    int a1 = 1, a2 = 1;
    for (int i = 3; i <= n; i++)
......................
阅读全部 | StarLiver 贴于 2022年4月15日 16:51     hide bbsi
/*
2022年4月15日16点29分
题目:输出如下图形:
         *
        ***
       *****
      *******
       *****
        ***
         *
*/

......................
阅读全部 | StarLiver 贴于 2022年4月15日 16:29     hide bbsi
#include<stdio.h>

void test(int arr[3][5]){}
void test(int arr[][]){}//错误,必须要有列

void test(int *arr){}//传入的是第一行的地址,使用接收不行
void test(int *arr[5]){}//指针数组,不行x
void test(int (*arr)[5]){}//数组名指向5个元素的数组
void test(int **arr){}//x  不行,不是二级指针
//传过去的是什么放什么基本上,可以数组,也可以是指针

int main()
......................
阅读全部 | nn154189906 贴于 2022年4月15日 15:31     hide bbsi
#include <stdio.h>

// int main()
// {
//     int a = 10;
//     int* pa = &a;
//     char ch = 'w';
//     char* pch = &ch;
    
//     double* d[5];
//     double* (*pd)[5] = &d; //pd 是一个数组值
    
......................
阅读全部 | nn154189906 贴于 2022年4月15日 15:24     hide bbsi
/*
2022年4月15日11点50分
题目:两个乒乓球队进行比赛,各出三人。甲队为a,b,c三人,乙队为x,y,z三人。
      已抽签决定比赛名单。有人向队员打听比赛的名单。a说他不和x比,c说他
      不和x,z比,请编程序找出三队赛手的名单。
*/

#include <iostream>
using namespace std;

int main()
{
......................
阅读全部 | StarLiver 贴于 2022年4月15日 11:50     hide bbsi
#include <stdio.h>

int main()
{
    int a = 10;
    int* pa = &a;
    char ch = 'w';
    char* pch = &ch;
    
    double* d[5];
    double* (*pd)[5] = &d; //pd 是一个数组值
    
......................
阅读全部 | nn154189906 贴于 2022年4月15日 11:05     hide bbsi
上一页 49 50 51 52 53 54 55 56 57 58 下一页