#include <iostream>
using namespace std;
int a, b;
int main()
{
cin >> a >> b;
if (a % b == 0 || b % a == 0) cout << "Sao Multiplos";
else cout << "Nao sao Multiplos";
return 0;
}
零食
#include <iostream>
using namespace std;
int main() {
double priceList[6] = {0, 4.00, 4.50, 5.00, 2.00, 1.50};
int no, num;
scanf("%d%d", &no, &num);
printf("Total: R$ %.2lf\n", priceList[no] * num);
return 0;
}
#include<bits/stdc++.h>
using namespace std;
int s,e;
int ans;
int main()
{
scanf("%d%d",&s,&e);
if(e<=s)
{
e=e+24;
}
ans=e-s;
printf("O JOGO DUROU %d HORA(S)\n",ans);
return 0;
}
DDD
#include<iostream>
#include<string>
using namespace std;
int main()
{
int x;
cin >> x ;
int a[] ={61,71,11,21,32,19,27,31};//务必在定义数组时确保两数组对应位置相同
string b[]={"Brasilia","Salvador","Sao Paulo","Rio de Janeiro","Juiz de Fora","Campinas",
"Vitoria","Belo Horizonte"};
string t="a"; //工具变量t,存在目的:确定输入的x是否在a数组中;
int i ;
for(i=0;i<8;i++) {
if(x == a[i]) {
t = b[i]; //将a与b联系起来
break; //程序运行过程中满足if则运行break结束循环,在这里结束for循环;提高运行效率。
}
}
if(t == "a") printf("DDD nao cadastrado");
else cout<<t;
return 0;
}
Stacked RNN(多层RNN)
1. 原理
多个全连接层可以堆叠,多个卷积层也可以堆叠。同理:RNN也可以堆叠形成多层RNN。 如下图所示:对于每一个时刻的输出 h t h_t ht,它既会作为下一个时刻的输入,…