Quizzes
Site Language: English
Українська
English
Русский
Programming Tests
Login
Sign Up
Programming Tests
Theory
Snippets
Papers
Landing
Android
Prices
FAQ
Cosmo Story
Terms and Conditions
Privacy Policy
Cookies Policy
Send Feedback
data-type-conversion
:
Content language: Русский
English
Что будет выведено на экран? #include <iostream> #include <string> template<int T> std::string StrangeFunc() { return StrangeFuncStruct<T>::value(); } template<int T, bool lt16 = (T<16)> struct StrangeFuncStruct { static std::string value() { return StrangeFuncStruct<T, (T<16)>::value(); } }; template<int T> struct StrangeFuncStruct<T, true> { static std::string value() { return std::string(1, T + ((T>9)?'A'-10:'0')); } }; template<int T> struct StrangeFuncStruct<T, false> { static std::string value() { return StrangeFuncStruct<(T/16)>::value() + StrangeFuncStruct<(T%16)>::value(); } }; int main() { std::cout << StrangeFunc<137+137*256>() << std::endl; }
data-type-conversion
Что будет выведено в результате выполнения данной программы: template<class T, class U> struct A{ struct dummy{char _[2];}; static char _(T); static dummy _(...); static const bool value=sizeof(_(U()))==sizeof(char); }; struct B{}; struct C:B{}; ... cout << A<B,C>::value << A<B,B>::value << A<C,B>::value;
data-type-conversion
Отметьте корректные способы вызова функций: vоid f(int,int); tеmрlаtе<сlаss Т> vоid f(Т,Т=Т());
data-type-conversion
← Prev
1
2
3
4
Next →
Sign Up Now
or
Subscribe for future quizzes