当前位置:网站首页>Classic examples of C language - adding two scores
Classic examples of C language - adding two scores
2022-07-24 00:26:00 【Blue_ lan18】
# include <stdio.h>
int main()
{
int numerator1, numerator2;// Defining molecules
int denominator1, denominator2;// Define denominator
int numerator = 0;
int denominator = 0;
printf("Please input two fractions(Separate with\",\"): ");
scanf("%d/%d, %d/%d", &numerator1, &denominator1, &numerator2, &denominator2);
numerator = numerator1 * denominator2 + numerator2 * denominator1;// The molecule of the last fraction
denominator = denominator1 * denominator2;// The denominator of the last fraction
printf("result = %d/%d\n", numerator, denominator);
return 0;
}
The final result is not the simplest score .
边栏推荐
猜你喜欢

Simple implementation and analysis of binary search tree

Mobile terminal H5 - a lifeline timeline

What are blue-green deployment, Canary release and a/b test

Comparison of the shortcomings of redis master-slave, sentinel and cluster architectures

Flutter | specifies the type of page return value

Detailed explanation of data warehouse standard -2022

【电赛训练】非接触物体尺寸形态测量 2020年电赛G题

NGFW portal authentication experiment

Flutter | the easiest way to add header and footer to listview

A good habit to develop when writing SQL
随机推荐
PHP implements stripe subscription
Jenkins 使用sonarqube构建流水线代码审查项目
数仓数据指标和标签体系区别
Application of encryption technology
Simple implementation and analysis of binary search tree
Gbase 8C session information function (II)
[wechat applet] design and interactive implementation of auction product details page (including countdown and real-time update of bids)
GBase 8c 字符串操作符
paypal订阅流程及api请求
Don't let Fujin Yibo see this
Redis持久化机制RDB、AOF
The prediction of domestic AI protein structure reproduced a breakthrough and solved the 3D structure with a single sequence. Peng Jian's team: "the last piece of puzzle since alphafold2 has been comp
GBase 8c 访问权限查询函数(五)
Detailed overview of data standards -2022
Gbase 8C string Operator
Robot dog back submachine gun shooting video fire, netizens shivering: stoooooooopppp!
Flutter | the easiest way to add header and footer to listview
Pytest interface automated testing framework | common running parameters of pytest
AWS Part 4 one machine and one secret
Tencent cloud was affirmed by international professional streaming media evaluation: video coding performance is the best in all three scenarios