-
-
32怎么理解 数组也是指针 这句话??
-
2
-
12
-
6为什么显示返回值被忽略: “scanf”,用if和whlie语句判断也不行,我还以为是编译器出问题了,但是我用holleworld是试了一下发现输出好像没问题,佬们救救我
-
18
-
4
-
9
-
53
-
3
-
5
-
2
-
8For this assignment, you will be writing testcases foryour next assignment (as usual, the instructions for that assignmentcan be found in next-README). As usual, one correct and many broken implementations can be foundin /usr/local/l2p/subseq. As with power, these are provided as compiled object files, and youshould write a C program (in test-subseq.c) whose main function teststhe maxSeq function. As before, it should exit with EXIT_SUCCESS if alltests pass, and EXIT_FAILURE if any test fails. Note that you willneed to write the prototype for maxSeq: size_t maxSeq(int * array, size_t n); in yo
-
0
-
6
-
4
-
1
-
2宝子吗,有用dev-c过二级c语言的吗?(我监考老师让我用这个),真的不想再考一次
-
11问一下哪里可以找到适合大一刷的c语言程序阅读题和程序设计题,学校的题太少了,网上找不到。马上要进行一个很重要的考试,我想考高分。
-
0利用泰勒级数:sinx≈x-x3/3!+x5/5!-x7/7!+x9/9!-…,计算sinx的值。要求最后一项的绝对值小于10^-5,并统计出共累加了多少项。 int main(){ int i = 1, count = 1; float x; double sum, precision; scanf("%f",&x); precision = x; sum = x; while (fabs(precision)>=1e-5) { precision = - precision*x*x / ((i+1)*(i+2)); sum = sum + precision; count++; i = i+2; } printf("sin=%lf, count = %d",sum,count); }
-
18
-
3#include<stdio.h>#include <string.h>void k(char* t, int len) { for (int i = 0; i < len / 2; i++) { char p = 0; p = t[lbk]i[rbk]; t[lbk]i[rbk] = t[lbk]len - 1 - i[rbk]; t[lbk]len - 1 - i[rbk] = p; }}int q(char* t, int len) { int sum = 0; for (int i = 0; i < len; i++) sum += ((int)(t[lbk]i[rbk]) << i); return sum;}char* addBinary(char* a, char* b) { int a1, b1, sum; char ans[lbk]100[rbk]; char* p = ans; k(a, strlen(a)); k(a, strlen(a)); a1 = q(a, strlen(a)); b1 = q(b, strlen(b)); sum = a1 + b1; int j = 0; while (sum) { p[lbk]j++[rbk] = sum % 2 + '0'; } p[lbk]j[rbk] = '0';
-
5
-
0还是五题,我想喝奶茶了?
-
114对于现在的大学教育,我是真的......唉!拿我大学为例,我们上C语言,一共几十个课时,绝大半是老师讲一些什么表达式、符合之类,甚至连函数都不教,就直接叫我们上黑板写程序,写不了还说我们。到现在,已经2025年了,还在用VC++6.0,甚至最后考试都用这屁玩意!问为什么不用新款,就说全校电脑都安装了这个,换了麻烦。教我的老师甚至还讲什么这个VC6.0哪怕到了我们工作时都有用的......离了个大谱!要不怎么说现在大学生找工作难呢:现
-
11计算机二级c语言,我当时直接点开.c默认打开dev做了,程序能运行也没错,生成的文件跟vc会一样吗?这样算分吗,心态崩了,可能没分了,
-
4
-
6
-
6不知道哪里错了... #include<iostream> #include<cstdio> #include<algorithm> #include<cmath> using namespace std; long long R,C,ans; long long area[101][101]={0}; long long mem[101][101]={0}; long long movex[4]={0,0,-1,1}; long long movey[4]={1,-1,0,0}; long long dfs(long long r,long long c) { if(mem[r][c]) return mem[r][c]; for(int i=0;i<4;i++){ int fr=r+movex[i]; int fc=c+movey[i]; if(fr>0 && fc>0 && fr<=R && fc<=C && area[r][c]>area[fr][fc]){ mem[r][c]=max(mem[r][c],dfs(fr,fc)+1); } } return mem[r][c]; } int main(
-
2如果可行想冲一下
-
4
-
87
-
40
-
28如题,发帖记录
-
5
-
4#include <stdio.h>#include <stdlib.h>#include <string.h>#define MAX_ITEMS 100#define MAX_USERS 10#define ADMIN_USER "admin"#define ADMIN_PASS "admin123"typedef struct { char name[50]; char code[20]; int quantity; float price; char lastAction[10]; char lastUser[50]; char lastTime[30];} Item;typedef struct { char username[20]; char password[20];} User;Item items[MAX_ITEMS];User users[MAX_USERS] = {{"user", "1234"}}; // 默认普通用户 int itemCount = 0; int userCount = 1; char currentUser[20]; // 保存数据到文件 void saveData() {
-
3#include<stdio.h> int main() { int m,n,i; printf("请输入2个0到200的整数\n"); scanf("%d %d",&m,&n); if(n<0||n>m||m>200) {printf("ERROR!"); return 1; } if (m==1) m=2; int sum=0; for(i=n;i<=m;i++){ int isprime=1; int k; for(k=2;k<i;k++){ if (i%k==0){ isprime=0; break;} if (isprime){ sum+=i;} } printf("素数和为;%d\n",sum); return 0; }
-
3
-
19
-
4过程: 74.小明想开个造纸飞机的公司,于是雇了5个人。接着他要求购买原材料 了,已知一包 A1纸中有4张纸,一张 A1纸能折7架飞机,每个员工要制造 100架飞机。 因为制造飞机 需要一个相对安静的环境,所以员工之间不能相互借纸,也不能提前裁纸。但 是老板小明可 以把一包纸拆开分给员工,以确保分给每个员工的纸张数量是一定的,又尽可 能得少用原材 料。求小明至少要买(B)包A1纸。 A. 16 B. 17 C. 18 D. 19
-
8学校用的是微软的Visual C++,但是我感觉这个工具一点都不好用。主要是对比我们学Python用的Pycharm工具,Pycharm在编程时写一个像int,float这样的函数的时候只要打出一个字母就会弹出很多对应的单词可以直接选择,很多时候不需要一个一个字母去打字。而且Pycharm在检测到使用了未安装的库情况下,只要这个库不是自定义库,都可以直接点击代码中那个库的名字来直接现场下载。但是这些功能Visual C++根本就没有,每次C语言写代码都要一个字母一个字母
-
2
-
5
-
142
-
3