Cpp Pls may i know why I don’t get the output #include <iostream> using namespace std; int main() { int n,n1,n2=n,rev=0; cout<<"Enter any number"; cin>>n; while(n) { n1=n%10; rev=rev*10+n1; n=n%10; } if(n2==rev) { cout<<"num is palindrome";} else { cout<...
Happy_number.cpp Palindromeofnumber.cpp Paranthesis Matching.cpp Primality Test.cpp Sparse matrix.cpp Strassen Matrix Multiplication.cpp String Fibonacci.cpp Tower of Hanoi.cpp fibonacci.cpp sieve_of_Eratosthenes.cpp smallest-circle.cpp spiral_print.cpp Range queries Search Sorting README.mdBreadcrumbs ...
Description: This code print all palindromes between a given range and also count the total number of palindromes */ #include<iostream> #include<math.h> using namespace std; bool isPalindrome(int ); int main() { int max_range,i,count=0; printf("Enter the maximum range (more than 10...
0009-palindrome-number.cpp 0010-regular-expression-matching.cpp 0011-container-with-most-water.cpp 0012-integer-to-roman.cpp 0013-roman-to-integer.cpp 0014-longest-common-prefix.cpp 0015-3sum.cpp 0017-letter-combinations-of-a-phone-number.cpp 0018-4sum.cpp 0019-remove-nth-node-from-end-of-lis...
Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array[−2,1,−3,4,−1,2,1,−5,4], the contiguous subarray[4,−1,2,1]has the largest sum =6. ...
Number 15.2 Ugly Number II 15.3 Super Ugly Number 15.4 Fraction to Recurring Decimal 15.5 Factorial Trailing Zeroes 15.6 Nim Game 15.7 模拟 16 Reverse Integer 16.1 Palindrome Number 16.2 Insert Interval 16.3 8 算法珠玑 Merge Intervals 16.4 Minimum Window Substring 16.5 Multiply Strings 16.6 Substring ...
最长回文子串 Longest Palindromic Substring.cpp 7 整数反转 Reverse Integer.cpp 9 回文数 Palindrome Number.cpp 12 整数转罗马数字 Integer to Roman.cpp 13 罗马数字转整数 Roman to Integer.cpp 15 三数之和 3Sum.cpp 最接近的三数之和 3Sum Closest .cpp 20 有效的括号 Valid Parentheses.cpp 22 括号...
还是觉得自己的第一次AC的代码太乱,网上搜了一下,模仿大神(http://yucoding.blogspot.sg/2013/01/leetcode-question-35-insert-interval.html)重新写了一版AC的代码。 /** * Definition for an interval. * struct Interval { * int start; * int end; ...
Username for 'https://gitee.com': userName Password for 'https://userName@gitee.com': # 私人令牌 master 分支(1) 管理 管理 master example-for-leetcode / 202HappyNumber.cpp 202HappyNumber.cpp 3.50 KB 一键复制 编辑 原始数据 按行查看 历史 supermaket 提交于 10年前 . 2015-07...
9、(0009)palindrome number(回文数) 10、(0010)regular expression matching(正则表达式匹配) 11、(0011)盛最多水的容器 12、(0012)roman numeral(整数转罗马数字) 13、(0013)roman to integer(罗马数字转整数) 14、(0014)longest common prefix(最长公共前缀) ...