下载附件之后点击安装,得到challenge文件。无壳。运行文件因为是.net文件所以用dnspy打开。之前运行文件的时候发现有个decode,发现有个btnDecode_Click函数。但是一直找不到这个dat_secret。下断点调试运行。运行出现flag。不咋会用dnspy,题稍微难点就不会了哈哈哈。
题目描述:Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321解题思路:这道题比较简单,只要注意两个问题:1,输入可能有123,-123两种情况。2,可能会出现值溢出的情况,所以先用long类型处理,决定没有溢出后再转换为int具体代码: 1publicstaticint reverse(int x) {2 String s =""+x;3char[] array=s.toCharArray();4if(array[0]==‘-‘){5 reverse(array,1);...
题目意思:int数字反转考虑:越界问题 1class Solution {2public:3int reverse(int x) {4long ans=0;5while(x){6 ans=ans*10+x%10;7 x=x/10;8 }9return (ans > INT_MAX || ans < INT_MIN)? 0 : ans;
10 }
11 };ps:leetcode中long比int要长,可是visual c++中long和int取值范围一样因而有了下面这种我认为更好的代码 1class Solution {2public:3int reverse(int x) {4int ans=0;5while(x>=10||x<...
/** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * };1. 。*/struct ListNode* reverseBetween(struct ListNode* head, int m, int n) { if(head==NULL||head->next==NULL) return head; int i,j; struct ListNode *p,*a,*q,*bot; p=(struct ListNode*)malloc(sizeof(struct ListNode)); p->next=head; bot=p; for(i=1;i<m;i++){ p=p->nex...
题目描述:
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.
If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it is.
You may not alter the values in the nodes, only nodes itself may be changed.
Only constant memory is allowed.
For example,Given this linked list: 1->2->3->4->5
For k = 2, you should return: ...