Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /******************************************************************************
- Welcome to GDB Online.
- GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby,
- C#, OCaml, VB, Perl, Swift, Prolog, Javascript, Pascal, COBOL, HTML, CSS, JS
- Code, Compile, Run and Debug online from anywhere in world.
- *******************************************************************************/
- #include <stdio.h>
- #include <string>
- using namespace std;
- typedef unsigned char uint8_t;
- typedef struct {
- uint8_t s;
- uint8_t m;
- uint8_t h;
- uint8_t DW;
- uint8_t D;
- uint8_t M;
- uint8_t Y;
- }_ctime;
- uint8_t DIASMES(uint8_t MES){
- uint8_t meses[12] = {31 , 28, 31 , 30 , 31 , 30 , 31 , 31 , 30 , 31 , 30 ,31};
- return meses[(MES+11)%12];
- }
- int main()
- {
- string a = "12/05/85";
- printf("%li",a.length());
- uint8_t buff;
- int vals = 8;
- buff = 0;
- for (int cont = 0 ; cont < a.length() ; cont++){
- switch(a[cont]){
- case '0':case '1':case '2':case '3':case '4':case '5':case '6':case '7':case '8':case '9':
- buff = buff*10 + a[cont];
- break;
- default:
- vals += (buff<<(vals%0xFF));
- printf(" %i ",(vals%0xFF));
- vals += 8;
- }
- buff+= a[cont];
- }
- printf("\n\n%8X",vals);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement