#include <stdio.h>
/*
函数指针、函数指针数组
*/
void menu()
{
printf("********************\n");
printf("****1.add 2.sub****\n");
printf("****3.mul 4.div****\n");
printf("********************\n");
......................
阅读全部
|
nn154189906
贴于 2022年4月16日 17:11
hide
bbsi
#include <stdio.h>
/*
函数指针、函数指针数组
*/
int add(int x, int y)
{
return x+y;
}
int sub(int x, int y)
{
......................
阅读全部
|
nn154189906
贴于 2022年4月16日 16:33
hide
bbsi
#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月16日 16:12
hide
bbsi
#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