zoukankan      html  css  js  c++  java
  • 培训第一天

    以下是在今天的学习过程中发现的一些难题,其中的知识需要将记忆和加强

    ①时间戳简化版:解此题需要用到“/”“%”,需熟练掌握其含义及用法

    ②数位交换:此题同样用到"/"%",但更重要的是在掌握其的基础上进行变通,从而达到交换数位的目的

    ③糖果分发:此题“=”出现次数较多,需注意,电脑编程中的“=”的意义与数学不同,“=”在此表示“赋值”,而不是数值相等

    加油!走过的曲折都会变成彩虹!

    共勉!

     1 #include<iostream>
     2 using namespace std;
     3 int main()
     4 {
     5     int x1,x2,x3,x4,x5;
     6     cin>>x1>>x2>>x3>>x4>>x5;
     7     x1=x1/3; x2=x2+x1; x5=x5+x1;
     8     x2=x2/3; x1=x1+x2; x3=x3+x2;
     9     x3=x3/3; x2=x3+x2; x4=x4+x3;
    10     x4=x4/3; x3=x3+x4; x5=x5+x4;
    11     x5=x5/3; x4=x4+x5; x1=x5+x1;
    12     cout<<x1<<' '<<x2<<' '<<x3<<' '<<x4<<' '<<x5<<endl;
    13     return 0;
    14 }
     1 #include<iostream>
     2 using namespace std;
     3 int main()
     4 {
     5     int x;
     6     cin>>x;
     7     int ge,shi,bai,qian;
     8     ge=x%10; shi=x/10%10; bai=x/100%10; qian=x/1000;
     9     x=ge*1000+shi*100+bai*10+qian;
    10     cout<<x<<endl;
    11     return 0;
    12 }
     1 #include<iostream>
     2 using namespace std;
     3 int main()
     4 {
     5     int x;
     6     cin>>x;
     7     int ge,shi,bai;
     8 ge=x%10; bai=x/100; shi=x/10%10;
     9 x=ge*100+shi*10+bai;
    10 cout<<x<<endl;
    11 return 0;
    12 }
     1 #include<iostream>
     2 using namespace std;
     3 int main()
     4 {
     5     int n;
     6     cin>>n;
     7     int a,b,c;
     8     a=n/31104000+1970;
     9     b=n/2592000-12*(a-1970)+1;
    10     c=n%2592000/86400+1;
    11     cout<<a<<' '<<b<<' '<<c<<endl;
    12     return 0;
    13 }

  • 相关阅读:
    hdu 1392 fzu 1333 Surround the Trees 简单凸包
    STL的应用 multiset bitset next_permutation
    hdu 3711 Binary Number 位运算(^ 与&)的应用
    鸽舍原理
    hdu 4002 Find the maximum 2011 大连网络赛 1002 Find the maximum
    组合数学
    Delphi程序破解技术概要
    NET的URL怎么静态化?
    David I谈Delphi的现状及未来发展方向
    使用Dede破解Delphi软件实战
  • 原文地址:https://www.cnblogs.com/zrjl/p/7244336.html
Copyright © 2011-2022 走看看