제출 #1118344

#제출 시각아이디문제언어결과실행 시간메모리
1118344AvianshPalindromic FizzBuzz (NOI19_palindrome)C++17
100 / 100
13 ms1996 KiB
#include <bits/stdc++.h> using namespace std; bool pal(long long n){ string s = to_string(n); for(int i = 0;i<s.size()/2;i++){ if(s[i]!=s[s.size()-i-1]){ return 0; } } return 1; } signed main(){ ios::sync_with_stdio(0); cin.tie(0); long long s,e; cin >> s >> e; for(long long i = s;i<=e;i++){ if(pal(i)){ cout << "Palindrome!\n"; } else{ cout << i << "\n"; } } return 0; }

컴파일 시 표준 에러 (stderr) 메시지

palindrome.cpp: In function 'bool pal(long long int)':
palindrome.cpp:7:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    7 |     for(int i = 0;i<s.size()/2;i++){
      |                   ~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...