第一名 高爾宣 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;
}
for (第一區;第二區;第三區) {
// 做一些事情
}
for (第一區;第二區;第三區)
........ ; // 做一件事情
# Hello_world.py
print("Hello world!") # 印出「Hello world!」
while(判斷式) {
做某些事
}
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