当前位置:网站首页>C语言 一元多项式求导
C语言 一元多项式求导
2022-06-30 01:25:00 【Martin の Blog】

算法设计思路
- 输入字符,如果检测到输入回车,则停止循环,执行程序
- 对连续输入的两个字符进行求导处理
- 如果常数项为0,则输出“0 0”
代码
#include <stdio.h>
int main(){
int a=0, b=0, flag=0;
char ch;
do{
scanf("%d %d", &a, &b);
ch = getchar();
if(b == 0){
if(flag == 0){
printf("0 0");
}
}else{
if(flag == 0){
printf("%d %d", a*b, b-1);
flag = 1;
}else{
printf(" %d %d", a*b, b-1);
}
}
}while(ch != '\n');
return 0;
}
运行结果

边栏推荐
- Kubernetes core object overview details
- ctfshow 大赛原题 680-695
- c语言期末不挂科(上)
- cookie加密8
- Varnish 基础概览7
- Application of pointer in STC89C52 single chip microcomputer and demonstration of practical cases
- Seata et les trois plateformes travaillent main dans la main pour programmer Summer, un million de bonus vous attend
- Embedded exit (review and release)
- 首届·技术播客月开播在即
- ES6 synchronous asynchronous execution and block level scope
猜你喜欢

Using tsne to visualize the similarity of different sentences

Seata 与三大平台携手编程之夏,百万奖金等你来拿
![[deep learning compilation] operator compilation IR conversion](/img/10/bdcabde772e65eebc93f870f597524.png)
[deep learning compilation] operator compilation IR conversion

Sentinel source code analysis Part 7 - sentinel adapter module - Summary

Cookie加密15 登录加密

Analysis of natural frequency and buckling load of cylinder by finite element method

How to unify the use of package manager in a project?

2022-06-29: x = {a, B, C, D}, y = {e, F, G, H}, the length of the two small arrays X and Y is 4. If yes: a + e = B + F = C + G = D + H

Clean, talk, bring children, and get rid of the label of "artificial mental retardation" for the sweeper

Kubernetes core object overview details
随机推荐
【推荐系统】基于用户的协同过滤简明原理与代码实现
ES6 synchronous asynchronous execution and block level scope
Mysql 监控2
VIM editor common instructions
Cub school learning: manual query and ADC in-depth use
MySQL installation steps (detailed)
How to seamlessly transition from traditional microservice framework to service grid ASM
Analysis of natural frequency and buckling load of cylinder by finite element method
Ansible ad-hoc temporary command
[535. encryption and decryption of tinyurl]
Cookie加密12
Analysis of IM instant messaging development technology on modern web
[mrctf2020]ezpop-1 | PHP serialization
Visual studio 2017 cannot open the include file: 'qopenglfunctions_3_3_core': no such file or directory
Cookie加密15 登录加密
如何统一项目中包管理器的使用?
MES管理系统功能模块之质量管理
TP-LINK configure WiFi authentication method for wireless Internet SMS
Seata 與三大平臺攜手編程之夏,百萬獎金等你來拿
画画水族馆的应用特色及功能