C language output all "Narcissus number" Author: Shine Time: 2019-03-27 Classification: C/C++ comment ># # # The so-called "narcissus number" refers to a 3-digit number, whose cubic sum of each digit equals to the overview itself. For example, 153 is the Narcissus Number, because ` 153=1 cube+5 cube+3 cube` #C language code implementation: >Because the 'pow' function is used (to find the y power/power of x, such as' pow (2, 3) ', to find the third power of' 2` >So we need to import the header file ` math. h` ```c #include <stdio.h> #include <math.h> int main() { int i, a, b, c; for(i=111; i<999; i++) { a = (i/100)%10; //Take hundreds b = (i/10)%10; //Take ten digit value c = i%10; //Take one digit value if(pow(a,3)+pow(b,3)+pow(c,3) == i){ printf("%d\t", i); } } } ``` #Compiled and run output: ``` 153 370 371 407 -------------------------------- Process exited after 0.2338 seconds with return value 0 ```
[Windows 10] FFmpeg uses NVIDIA GPU acceleration Author: Shine Time: 2019-03-27 Classification: Windows comment #Support NVIDIA graphics card list > ### https://developer.nvidia.com/video-encode-decode-gpu-support-matrix #The command is as follows ``` ffmpeg -hwaccel cuvid -c:v h264_cuvid -i <input.flv> -c:v h264_nvenc <output.mp4> ``` Reference: 1 [ https://blog.csdn.net/qq_39575835/article/details/83826073 ][1] 2. [ http://www.cnblogs.com/yahle/p/8045063.html ][2] [1]: https://blog.csdn.net/qq_39575835/article/details/83826073 [2]: http://www.cnblogs.com/yahle/p/8045063.html
IntelliJ IDEA registration code Author: Shine Time: 2019-03-22 Classification: Chatter comment ###IntelliJ IDEA registration code:<a href=“ http://idea.lanyus.com/ " target="_blank"> http://idea.lanyus.com/ </a>
JS quick resolution URL Author: Shine Time: 2019-03-10 Classification: JavaScript comment ># # This article will tell you how to use JS to quickly parse a URL and get information such as protocol, host, port, and query string. #Use the '<a>' element or 'URL' object to quickly parse: ``` function parseURL(url) { var a = document.createElement('a'); a.href = url; // var a = new URL(url); return { source: url, protocol: a.protocol.replace(':', ''), host: a.hostname, port: a.port, query: a.search, params: (function() { var params = {}, seg = a.search.replace(/^\?/, '').split('&'), len = seg.length, p; for (var i = 0; i < len; i++) { if (seg[i]) { p = seg[i].split('='); params[p[0]] = p[1]; } } return params; })(), hash: a.hash.replace('#', ''), path: a.pathname.replace(/^([^\/])/, '/$1') }; } console.log(parseURL(' https://test.com:8080/path/index.html?name=angle&age=18#top ')); ``` Reprinted from: http://ghmagical.com/article/page/id/SgIVenH42dyN
C language to solve the problem of "chicken and rabbit in the same cage" Author: Shine Time: 2019-02-28 Classification: C/C++ comment #Introduction to "chicken and rabbit in the same cage" ># # Mainly investigate the use of 'for loop' ># # The chicken rabbit cooping problem is a kind of famous arithmetic problem in ancient China, which can be traced back to the mathematical work Sun Tzu Suanjing in the Northern and Southern Dynasties. In fact, it belongs to the problem of linear equations. #C code: ```c // // Created by NowTime on 2019/2/28. //Solution procedure of chicken and rabbit in the same cage // #include <stdio.h> #include <stdlib.h> void main() { int heads, feet; Printf ("Solver for chicken and rabbit problems in the same cage n"); Printf ("Please be sure to enter a positive integer! \n"); Printf ("Otherwise, it will get stuck .. You can only press Ctrl+C or click X in the upper right corner to close the program n n "); Printf ("Please enter" Number of chickens and rabbits ":"); scanf_s("%d", &heads); Printf ("Please enter" Number of feet ":"); scanf_s("%d", &feet); int rabbit, chicken, count_feet; for(chicken=1; chicken<=heads; chicken++){ rabbit = heads-chicken; //Chicken=number of heads - number of rabbits count_feet = (chicken*2)+(rabbit*4); //Number of feet=number of chickens * 2 legs+number of rabbits * 4 legs //If the calculated number of feet is equal to the number of input feet, the output if(count_feet == feet){ Printf ("chicken:% d, rabbit:% d n", chicken, rabbit); break; //Exit loop } } system("pause"); //Pause. Press any key to exit the program. You need to import the header file # include<stdlib. h> } ``` #Output results: ``` PS D: C Language> /Chicken and rabbit cage resolver.exe Solution procedure for chicken and rabbit in the same cage Please be sure to enter a positive integer! Otherwise, it will get stuck .. You can only press Ctrl+C or click the X in the upper right corner to close the program Please enter "Number of chickens and rabbits": 10 Please enter "Number of feet": 30 There are 5 chickens and 5 rabbits Please press any key to continue . . ``