Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/66.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql 求给定数的和_Mysql_Math - Fatal编程技术网

Mysql 求给定数的和

Mysql 求给定数的和,mysql,math,Mysql,Math,我需要帮助,例如,给定的数字是55,我想知道有多少个10,(因此在55中有五个10),在程序中它必须显示余数(在55中,因为有五个10,余数是5),我怎么做 (必须显示类似的内容) 输入金额:55 10个的数量:5个 余数:5使用模运算符%类似 select floor(55/10) as divisor, 55%10 as reminder from dual 看看算术运算符,特别是除数和模:要解决这个问题,您需要除法和模运算符,还有一点内置地板方法的帮助:) 接下来,您需要做的是: sel

我需要帮助,例如,给定的数字是55,我想知道有多少个10,(因此在55中有五个10),在程序中它必须显示余数(在55中,因为有五个10,余数是5),我怎么做

(必须显示类似的内容)
输入金额:55
10个的数量:5个

余数:5

使用模运算符
%
类似

select floor(55/10) as divisor, 55%10 as reminder
from dual

看看算术运算符,特别是除数和模:

要解决这个问题,您需要
除法
和模
运算符
,还有一点内置
地板
方法的帮助:)

接下来,您需要做的是:

select floor(55/10) as [Numer of tens], 55 % 10 as remainder
#包括
int main(){
整数除数、除数、商、余数;
printf(“输入股息:”);
scanf(“%d”和红利);
printf(“输入除数:”);
scanf(“%d”和除数);
//计算商
商=被除数/除数;
//计算余数
余数=股息%除数;
printf(“商=%d\n”,商);
printf(“余数=%d”,余数);
返回0;
}

楼层(55/10)应该是。谢谢,我不知道我的问题会在今天得到回答fast@RhylaJaezyllBete如果这对你有帮助,请把它标记为答案:)是的,你很好!希望这能对我有所帮助,我在这方面做得很慢stuff@RhylaJaezyll Bete如果这有助于你,你可以通过按向上箭头按钮进行向上投票。这根本不像MySQL。他们只是说程序请阅读问题下的标签(
MySQL
math
)。如果你阅读了关于这个问题的其他答案,它们都是MySQL的。
#include <stdio.h>
int main(){

    int dividend, divisor, quotient, remainder;

    printf("Enter dividend: ");
    scanf("%d", &dividend);

    printf("Enter divisor: ");
    scanf("%d", &divisor);

    // Computes quotient
    quotient = dividend / divisor;

    // Computes remainder
    remainder = dividend % divisor;

    printf("Quotient = %d\n", quotient);
    printf("Remainder = %d", remainder);

    return 0;
}