Find the completion within 1000 in C language Author: Chuwen Time: 2019-03-27 Classification: C/C++ comment ``` #include <stdio.h> #include <math.h> int main() { int i, a, b; for(i=1; i<=1000; i++) { b=0; for(a=1; a<=i/2; a++){ if(i%a == 0){ b=b+a;// Add all the factors } } if(b == i){ printf("%d its factors are ", i); for(a=1; a<=i/2; a++){ if(i%a == 0){ printf(",%d", a); } } printf("\n"); //Printf ("% d is the end n", i); } } } ```
C language output all "narcissus number" Author: Chuwen 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: Chuwen 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: Chuwen 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: Chuwen 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