Evalutaion方法评估喜欢和不喜欢的人 [英] Evalutaion Method to evaluate person upon likes and dislikes
本文介绍了Evalutaion方法评估喜欢和不喜欢的人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好我的朋友..我有带有字段的用户表(喜欢(int)和不喜欢(int))..
我有500个用户。用户(A)有(喜欢= 80)&(不喜欢= 30)。
我想评估这个用户(A)>> (...%)喜欢和不喜欢的数量。
我怎么能这样做?
解决方案
嘿那里,
我看你想要计算喜欢和不喜欢的百分比:
在此检查此示例:
int likes = 80 跨度>;
int 不喜欢= 30 ;
int c =喜欢+不喜欢;
double likesPerc =(( double )like / c)* 100 跨度>;
double dislikesPerc =(( double )不喜欢/ c)* 100 跨度>;
希望有帮助
Azee ......
Hello my friends.. I have Users table with fields (likes (int) & dislikes (int)) ..
I have 500 users. user (A) has (likes = 80) & (dislikes = 30).
I want to evaluate this user (A) >> ( ... % ) upon number of likes and dislikes.
How could I do that ??
解决方案
Hey there,
I see you want to calculate the percentage of Likes and Dislikes:
Here check this example:
int likes = 80; int dislikes = 30; int c = likes + dislikes; double likesPerc = ((double)likes/ c) * 100; double dislikesPerc = ((double)dislikes / c) * 100;
Hope it helps
Azee...
这篇关于Evalutaion方法评估喜欢和不喜欢的人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文