#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
#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
#include <stdio.h>
int main()
{
int a[] = {1,2,3,4,5};
int b[] = {2,3,5,6,7};
int c[] = {1,4,5,6,8};
int* arr[] = {a, b, c};
int i = 0;
for (i = 0; i < 3; i++)
{
......................
阅读全部
|
nn154189906
贴于 2022年4月15日 10:39
hide
bbsi
/**
* 【程序8】
* 题目:输出9*9口诀。
* 程序分析:分行与列考虑,共9行9列,i控制行,j控制列。
*/
#include<stdio.h>
int main() {
int i,j,result;
printf("\n");
for (i=1;i<10;i++) {
......................
阅读全部
|
我想初学编程
贴于 2022年4月12日 14:11
hide
bbsi
#include <stdio.h>
double jc(int o);
int main (void)
{
double s,e=1;
int i,n;
scanf("%d",&n);
if(n>=0&&n<=1000){
for(i=1;i<=n;i++)
{
s=jc(i);
e=e+1.0/s;
......................
阅读全部
|
elhut
贴于 2022年4月5日 21:14
hide
bbsi
/**
* 【程序25】
* 题目:求1+2!+3!+...+20!的和。
* 分析:此程序只是把累加变成了累乘。
*/
#include <stdio.h>
void main(){
int b = 1, i , j ;
float sum = 0;
for ( j = 2 ; j <= 20; j++) {
......................
阅读全部
|
代码之光
贴于 2022年4月5日 15:43
hide
bbsi
/*
2022年3月29日14点15分
输入年份、月份、日期,输出这一天是该年份下的第几天。
*/
#include <iostream>
using namespace std;
int run(int year)
{
if (year % 4 == 0 && year % 100 != 0) return true;
else if (year % 400 == 0) return true;
......................
阅读全部
|
StarLiver
贴于 2022年3月29日 14:16
hide
bbsi
#include <stdio.h>
int gcd(int numa,int numb,int numc);
int i,j=1,k,d;
int a,b,c;
int main() {
scanf("%d %d %d",&a,&b,&c);
d=gcd(a,b,c);
return 0;
}
//最大公约数
int gcd(int numa,int numb,int numc){
int a=1;
......................
阅读全部
|
anlagreenya
贴于 2022年3月29日 00:02
hide
bbsi
#include <stdio.h>
/*int main(){
int a=10;
int c;
float b;
c=a/3.0;
b=((double)(3/2)+0.5+(int)1.99*2);
printf("%d\n",c);
printf("%1f",b);
// return 0;
}*/
......................
阅读全部
|
xutingting
贴于 2022年3月28日 23:22
hide
bbsi