Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int limit; cout<<"Limit? "; cin>>limit;
- cout<<"\\table{ n & a hatszögszám & a vizsgált eset sorszáma "<<"\\\\\n";
- int curr=28, id=4, i=1;
- bool was=false;
- while(curr<=limit){
- cout<<id<<" & "<<curr<<" & "<<i<<"."<<((curr<limit) ? ((was=true), "\\\\") : ((was=false), ""))<<"\n";
- id++; i++;
- curr+=4*(id-1)+1;
- }
- if (was) {
- cout<<id<<" & "<<curr<<" & "<<i-1<<"+1"<<"\n";
- }
- cout<<"}";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement