第一名 高爾宣 OSN / 沒了妳 Without You
第二名 鄧紫棋 G.E.M. / 差不多姑娘 Miss Similar
#include <iostream>
// Recycling 7 cups can get 1 cup
int calculate(int x)
{
if (x < 7) {
return x;
} else {
return x - (x % 7) + calculate(x % 7 + x / 7);
}
}
int main()
{
int n; // buy cup(s)
std::cin >> n;
std::cout << calculate(n) << std::endl;
}
int i;
scanf("%d", &i);
switch (i) {
case 1: // 這是冒號
// Do something
break;
case 2:
// Do something
break;
case 100:
case 200:
// Do something
break;
default:
// Do something
break;
}
int main() {
long int l = 20L;
int i = 3;
float f = 3.2f;
double d = 5.4;
l = i; // (O)
i = l; // (O)
f = d; // (O)
d = f; // (O)
}
int main() {
long int l = 20L;
int i = 3;
float f = 3.2f;
double d = 5.4;
l = f; // (O) 會無條件捨去
i = d; // (O) 會無條件捨去
f = i; // (O)
d = l; // (O)
}
#include <stdio.h>
int main() {
printf("%d %d\n", 29 & 18, 30 & 11);
return 0;
}
16 10
#include <stdio.h>
int main() {
printf("%d %d\n", 29 & 0xF, 30 & 0xF);
return 0;
}
13 14
#include
int main ()
{
double a, b, c, d, e, f;
double g, h;
double x, y;
scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f);
if (a/b==d/e)
{
if (a/b==c/f)
{
printf("無限多組解");
}
else
{
printf("無解");
}
}
else
{
g=a*e-d*b;
h=c*e-f*b;
x=h/g;
y=(c-a*x)/b;
printf("%f %f", x, y);
}
return 0;
}
# Install required dependencies if needed
sudo apt-get install apt-transport-https gpgv
# Remove legacy repos
sudo dpkg --purge kxstudio-repos-gcc5
# Download package file
wget https://launchpad.net/~kxstudio-debian/+archive/kxstudio/+files/kxstudio-repos_10.0.3_all.deb
# Install it
sudo dpkg -i kxstudio-repos_10.0.3_all.deb
只要您幫我們的每篇文章都按5個讚,我們就會收到來自LikeCoin基金會的贊助喔!
您只需要登入帳號(Facebook、Google)並支持我們,完全不會花到錢!
2019上半年的文章可能有加上LikeCoin,但未設定確實,以致多篇文章的LikeCoin按讚數為共用,大大影響到我們獲得的讚數與收益。更早期前的文章則欠缺良好排版,也未加設有LikeCoin的贊助回饋。
#include <stdio.h>
int main() {
printf("%d, %d, %d\n", !(53==8), !0, !1);
return 0;
}
1, 1, 0
左邊 | 右邊 | 左邊 && 右邊 |
---|---|---|
0 | 0 | 0 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |
#include <stdio.h>
int main() {
printf("%d, %d, %d\n", 1 && 0, (3==8) && (4==4), 1 && 1);
return 0;
}
0, 0, 1
#include <stdio.h>
int main() {
printf("%d %d\n", 5 * 9 + 3 + 5, 7 * (3 + 2) / 8);
printf("%f %f", 3.1 * 6.2, 5.8 + 2.4 / 0.8);
return 0;
}
53 4
19.220000 8.800000
#include <stdio.h>
int main() {
printf("%d", 57%13);
return 0;
}
5